JDBC connection to SQL Server 2005 Instance running on remote machine

11,092

It may be a driver version problem, since it has been a long time since the JDBC driver has been included in one Jar. More likely, the URL format you are using isn't recognized by your old driver.

You can get the latest JAR here.

Share:
11,092
Krishna
Author by

Krishna

Java Programmer..

Updated on June 04, 2022

Comments

  • Krishna
    Krishna almost 2 years

    I am trying to connect to sql server 2005 instance running on a remote machine from my spring web application. This web application is running in tomcat server. Earlier When I connected to sql server 2000, it worked fine. I used msbase.jar, mssqlserver.jar, msutil.jar to connect to sql server 2000. My connection String was

    jdbc:microsoft:sqlserver://192.168.0.38:1433;DatabaseName=AndroidPOC 
    

    But now when I try to connect to sql server 2005. Iam getting all sorts of problems. I tried out various things but of no use.

    My connection string for sql server 2005 was

    jdbc:sqlserver://192.168.0.202;instanceName=INSTANCE_NAME;DatabaseName=MYDATABASE
    

    Please help me with the steps to connect to 2005 sql server.

    1. What are all the jars required.
    2. Do i need to update sql server jdbc driver, if yes how.
    3. The driver class name to be used.
    4. If possible please provide some sample code using spring jdbc and normal jdbc as well.
  • Krishna
    Krishna almost 13 years
    Thanks mate. Issue Resolved by removing msbase.jar, mssqlserver.jar, msutil.jar files and adding sqljdbc4.jar file.