게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.
* 고객시스템명 : 커널시스템즈
* GAUCE 버전 : 4.0
* WAS 종류(WebLogic 등등) : weblogic
* DB 종류 : oracle
* 문의 유형(질문/요청/참조) : 가우스 에러
* 내용 :
자바로 디비에 연결하고...핸들링하는 프로그램입니다..
샘플에 있던 건데요...
import java.io.*;
import java.util.*;
import java.text.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.gauce.*;
import com.gauce.lib.*;
import com.gauce.util.*;
public class edu_01_sl01 extends HttpServlet implements gauceDefine{
public void doGet(HttpServletRequest req, HttpServletResponse res)
{
Connection dbcon = null;
Statement stmt = null;
String dbDriver ="oracle.jdbc.driver.OracleDriver";
String dburl ="jdbc:oracle:thin:@127.0.0.1:1521:orcl";
String dbuser ="scott";
String dbpasswd ="tiger";
try{
Class.forName(dbDriver);
}catch(ClassNotFoundException e){
System.out.println("ClassNotFoundException Error ===> n "+e.toString());
}
try{
dbcon = DriverManager.getConnection(dburl, dbuser, dbpasswd);
}catch(SQLException e){
System.out.println("SQLException Error ===> "+e.toString());
}
try{
res.setContentType("text/html;charset=8859_1");
PrintWriter out = res.getWriter();
gauceControlObj dataBuf = new gauceControlObj(req,out,TB_WORK_NORMAL);
try{
int rcnt = 0;
int rtn = 0;
String sSql ="";
String strErr ="";
String in_emp_nm = req.getParameter("EMP_NM");
gauceDataSet dataSet = dataBuf.createDataSet();
rtn = dataSet.MakeDataSetInfo("EMP_NM",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("GRADE_NM",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("EMP_NO",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("DEPT_NM",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("S_LEVEL_NM",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("GRADE_CD",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("DEPT_CD",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("BIRTH_DATE",gauceDefine.TB_STRING);
rtn = dataSet.MakeDataSetInfo("LEVEL_CD",gauceDefine.TB_STRING);
if(dataBuf.MakeColumn(dataSet) == 0){
stmt = dbcon.createStatement();
gauceRecordSet rec = null;
sSql = " SELECT x.EMP_NM,y1.GRADE_NM,x.EMP_NO, " +
" y2.DEPT_NM,y3.S_LEVEL_NM,y1.GRADE_CD, " +
" x.DEPT_CD,x.BIRTH_DATE,x.LEVEL_CD " +
" FROM tb_emp_info1 x,tb_grade y1,tb_dept y2,tb_level y3 " +
" WHERE x.GRADE_CD = y1.GRADE_CD (+) " +" AND x.DEPT_CD = y2.DEPT_CD (+) " +
" AND x.LEVEL_CD = y3.S_LEVEL_CD (+) " +
" AND x.EMP_NM LIKE '%'||'"+in_emp_nm+"'||'%'";
ResultSet rset = stmt.executeQuery(sSql);
while(rset.next()){
rec = new gauceRecordSet(gauceDefine.TB_JOB_NORMAL);
rec.setString("EMP_NM",gauceUtil.UniToEuc(rset.getString("EMP_NM")));
rec.setString("GRADE_NM",gauceUtil.UniToEuc(rset.getString("GRADE_NM")));
rec.setString("EMP_NO",rset.getString("EMP_NO"));
rec.setString("DEPT_NM",gauceUtil.UniToEuc(rset.getString("DEPT_NM")));
rec.setString("S_LEVEL_NM",gauceUtil.UniToEuc(rset.getString("S_LEVEL_NM")));
rec.setString("GRADE_CD",rset.getString("GRADE_CD"));
rec.setString("DEPT_CD",rset.getString("DEPT_CD"));
rec.setString("BIRTH_DATE",rset.getString("BIRTH_DATE"));
rec.setString("LEVEL_CD",rset.getString("LEVEL_CD"));
dataSet.addRow(rec,true);
}
if(strErr.length() > 0 ) dataBuf.printResult(false,"ERROR : " + strErr);
else dataSet.setLastRow(true);
rset.close(); }
}catch(Exception e){
dataBuf.printResult(false,"ERROR :" + e.toString());
}
stmt.close();
dbcon.close();
}catch(Exception e){
System.out.println("error ===> " + e.toString());
}
}
}
에서 컴파일을 시키면...
---------- javac ----------
edu_01_sl01.java:7: package com.gauce does not exist
import com.gauce.*;
^
edu_01_sl01.java:8: package com.gauce.lib does not exist
import com.gauce.lib.*;
^
edu_01_sl01.java:9: package com.gauce.util does not exist
import com.gauce.util.*;
^
이렇게 나옵니다..
이것 때문에 아래 있는 GauceDataSet부분도 당연히 에러가 나오구요...
어떻게 해야 할까요?
정말...
초보라서...
환경 변수도 바꿔보기도 하고...
여러 자료도 봤지만...
몰라서 올립니다...
꼼꼼하게 설명 부탁드립니다....