Connection failure when upgrading to SQL Server 2005 JDBC driver (SQLJDBC.jar)

Date:Archived
Product/Release:LANSA Integrator
Abstract:Upgrading to SQL Server 2005 JDBC driver (SQLJDBC.jar) causes connection failure for exising SQLService
Submitted By:LANSA Technical Support

Description:

When using the latest SQL Server 2005 JDBC driver, called SQLJDBC.jar, to connect to existing Microsoft SQL Server Database, the loading or the connect of the database driver fails.

Cannot load JDBC driver : com.microsoft.jdbc.sqlserver.SQLServerDriver

Prior to using the latest driver, the driver for SQL Server 2000 was being used and the connection/loading of the driver was successful.

Solution:

Open the jar file for SQL Server 2005 JDBC driver, that is, SQLJDBC.JAR.  Check the path for the class SQLServerDriver.

You will notice that the path is different in the SQL 2005 driver to that provided in the SQL 2000 driver.

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");     // 2005 version
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");     // 2000 version

Hence you will need to change the SQLService.properties file to reflect this.

There should be an entry in the SQLService.properties file similar to

driver.sqlserver=com.microsoft.sqlserver.jdbc.SQLServerDriver