12th Jul2006

JDBC for MS SQL Server 2000 & 2005 – Spot the difference

by Jon Beattie

This was clearly some geek’s idea of a joke when they wrote this code. Here is the connection URL and class name for JDBC connection to a MS SQL Server 2000 database:

jdbc:microsoft:sqlserver://SQLSERVER;DatabaseName=DATABASE;selectMode=cursor;
com.microsoft.jdbc.sqlserver.SQLServerDriver

For the new MS SQL Server 2005 JDBC driver:

jdbc:sqlserver://SQLSERVER;DatabaseName=DATABASE;selectMode=cursor;
com.microsoft.sqlserver.jdbc.SQLServerDriver

Spot the difference yet? The new connection string URL doesn’t have microsoft in it, and the new class names has the jdbc and sqlserver switched around.

jdbc:sqlserver://SQLSERVER;DatabaseName=DATABASE;selectMode=cursor;port=1433
com.microsoft.sqlserver.jdbc.SQLServerDriver

Good way to drive a developer crazy for a little while when migrating their application to SQL Server 2005. I think this is Microsoft’s way of messing with you for using Java instead of .NET for your application.

Off

Comments are closed.