views:

131

answers:

1

DriverManager#getConnection() returns null when I am deploying my JSP/Servlet package in a Windows 2003 Server environment (64 bit). The database is Microsoft SQL 2005 Enterprise Edition.

The code is:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:calsoft2k","xxx","xxx");

The same code is working without any problems in Windows XP (32 bit) box. I am using Apache Tomcat 6.X server in both production and development environment.

Any pointers?

+1  A: 

Use a real JDBC driver instead of the (pardon me) lousy ODBC bridge driver.

Decent DB vendors supplies their own JDBC drivers. The one for SQL2005 can just be found at microsoft.com. This driver is however known not to be very optimal in both the performance and the level of JDBC API support. You could also consider the much faster and better jTDS driver instead.

BalusC
as always BalusC is great, now i am fan of BalusC :-)
sansknwoledge