JdbcOdbcDriver « ODBC « Java Database Q&A





1. Is there an alternative to using sun.jdbc.odbc.JdbcOdbcDriver?    stackoverflow.com

I recently migrated an older application we have at work from Java 1.5 to 1.6. I noticed that during the build, I now get a (new) compiler warning: ... DatabaseSession.java:[9,20] ...

3. sun.jdbc.odbc.JdbcOdbcDriver    coderanch.com

4. sun.jdbc.odbc.JdbcOdbcDriver    coderanch.com

5. java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver    java-forums.org

package opp2New; import java.io.*; import java.sql.*; import java.util.*; public final class Connection { private static Connection instance; Connection con = null; /** * */ private Connection (){ } public static Connection getInstance() { if(instance==null) instance = new Connection(); return instance; } public Connection getConnection(){ try { Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); String url="jdbc:odbc:library"; con = DriverManager.getConnection (url,"db2admin","db2admin"); } catch (SQLException e) { // TODO ...

6. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");    forums.oracle.com

I am out of ideas: the above statement works perfectly well within a simple java program, but in an applet it produces a runtime exception of 'class not found'. This happens even with the supplied example program 'OutputApplet.java'. I'm sure it is something straight forward but I have tried everything I can think of. Can anybody offer advice? Alan.

7. Help with java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver    forums.oracle.com

private java.sql.Connection getConnection() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = java.sql.DriverManager.getConnection (getConnectionUrl(),userName,password); if(con!=null) System.out.println("Connection Successful!"); } catch(Exception e) { e.printStackTrace(); System.out.println("Error Trace in getConnection() : " + e.getMessage()); } return con; } /* Display the driver properties, database details */ public void displayDbProperties() { java.sql.DatabaseMetaData dm = null; java.sql.ResultSet rs = null; try { con= this.getConnection(); if(con!=null) { dm = con.getMetaData(); System.out.println("Driver ...