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 driver with SQL Server

843859Dec 16 2005 — edited Dec 21 2005
i have used type 2 driver for connectin to my SQL Server. Its working fine with normal java program. but when i used the same driver in my servlet its returning null pointer exception. i.e. Connection is null

here is the code i have used:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn =DriverManager.getConnection("jdbc:odbc:mydsn",
"username",
"password");
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2006
Added on Dec 16 2005
6 comments
104 views