Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jdbc-odbc-bridge

843859Nov 29 2005
Hello!

I try to connect to a database with jdbc-odbc-bridge under linux. The odbc-connection are built on in the console, but i can't connect with my java application. The following code i will use to connect to the database:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String URL = "jdbc:odbc:hyplog";

Connection c = DriverManager.getConnection(URL);
return c;

I get the following error:

java.lang.NullPointerException
at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:193)
at ProConnection.getConnection(ProConnection.java:14)
at testmain.main(testmain.java:12)

I have no other possibility to connect to the server. Under windows the connection works fine, but under linux it doesn't. The connection under the linux console works, also the odbc-connection under openoffice2.

Can anyone help me to connect to the database.

Best regards
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2005
Added on Nov 29 2005
0 comments
129 views