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.showMessageDialog(null,"Connection Established");

     ///unrelated code snipped            
}    
5
  • 4
    You may have 'installed' the JDBC driver, but you haven't put the jar file containing it into your classpath. Commented Jul 16, 2011 at 20:53
  • for example netbeans.org/kb/docs/ide/oracle-db.html Commented Jul 16, 2011 at 21:24
  • @bmargulies: the JDBC-ODBC bridge driver is a standard part of any Windows JRE. There's no need to install it or put a JAR anywhere, it should just work. Commented Jul 16, 2011 at 22:03
  • @Luke, oh, that old thing. I didn't realize he was making the mistake of trying to use it, as opposed to the real JDBC driver. Commented Jul 16, 2011 at 23:15
  • Is there a reason for using the JDBC ODBC bridge. Maybe you can use the Oracle Thin driver, a type 4 JDBC driver implemented in pure Java. It does not have the overhead in bridging from ODBC to JDBC and back to ODBC? Commented Jul 17, 2011 at 6:49

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.