开发者

classNotFoundException when trying to use Oracle JdbcOdbcDriver

开发者 https://www.devze.com 2023-03-20 23:47 出处:网络
I have successfully installed an ODBC driver. I am trying to connect to an Oracle 10g database using Netbeans 7.0.

I have successfully installed an ODBC driver. I am trying to connect to an Oracle 10g database using Netbeans 7.0.

During connectivity it says "Driver class missing".

How can this be fixed?

Error:

java.lang.classNotFoundException:oracle.jdbc.odbc.JdbcOdbcDriver

try
{
    // Load the JDBC driver       
    String driverName = "oracle.jdbc.odbc.JdbcOdbcDriver";
    Class.forName(driverName);           
    connection = DriverManager.getConnection("jdbc:odbc:placement");
    JOptionPane.showMe开发者_开发百科ssageDialog(null,"Connection Established");

     ///unrelated code snipped            
}    


I think you've got the name of the class wrong. Try sun.jdbc.odbc.JdbcOdbcDriver instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消