java.lang.ClassNotFoundException:java oracle.jdbc.driver.OracleDriver

时间:2015-10-24 09:49:46

标签: java sql-server oracle jdbc

<%@page import  ="java.sql.*" %>
<%
String DBDRIVER = "oracle.jdbc.driver.OracleDriver";
String DBURL = "jdbc:oracle:thin:@hostname:8080:orcle:YK";
String DBNAME = "himyorcle";
String DBPASS = "123456";
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
boolean flag = false;
String sql = "SELECT * FROM JOB_OPENNING";
try {
    Class.forName(DBDRIVER);
    conn = DriverManager.getConnection(DBURL,DBNAME,DBPASS);
    pstmt = conn.prepareStatement(sql);
    pstmt = conn.prepareStatement(sql);
    pstmt.setString(1,c_id);
    pstmt.setString(2,job_id);
    pstmt.setString(3,posinfo);
    pstmt.setString(4,no_new);
    pstmt.setString(5, title);
    rs = pstmt.executeQuery();
    int i =1;
    if(rs.next()) {
        out.println(rs.getString(i));
        i++;
    }

    rs.close();
    pstmt.close();
    conn.close();

   }catch (Exception e) {
         out.println(e);
   }
   %>

当我这样做时,我已经为ojdbc6.jar和ojdbc6_g.jar构建了类路径和环境路径。但是,它仍然存在问题。

我不知道为什么。我在这个计划中有JAR。

0 个答案:

没有答案