Posts

Showing posts with the label SQL Server 2005

Connecting to SQL Server 2000 and SQL Server 2005 DB using JAVA

After 'Connecting to Multiple DBs using torque',now lets get Connected to Sql Server db. Why always connecting to DB? Won't we have any other better topics than this. We do, but you will probably have to wait for that. There is a reason why this topic is been chosen.Though connecting to MS SQL Server-2000 and SQL server2005 sounds same , but its not. And I even wont say that there are huge changes that we need to do for this. There are few things that we definitely need to be aware of before connecting to either of these DBs. a) We need three jar files to connect to Sql Server 2000.If I say 3 jars in this blog, then they are msutil.jar,mssqlserver.jar,msbase.jar. If we Use these three jar files, then the driver that we need to use is "com.microsoft.jdbc.sqlserver.SQLServerDriver" b) Instead of using the 3 jars, we can use only one jar, sqljdbc.jar , to connect to SQL server 2000 DB. Now we need to use "com.microsoft.sqlserver.jdbc.SQLServerDriver...