Installing and using MS SQL JDBC Driver?

2019-05-26 22:29发布

问题:

I am trying to install JDBC Drivers for MS SQL Server instance running on my local workstation. This http://support.microsoft.com/kb/313100 link starts a tutorial on getting started with JDBC. However it asks me to configure the following four env variables:-

  1. \Your installation path\Lib\Msbase.jar
  2. \Your installation path\Lib\Msutil.jar
  3. \Your installation path\Lib\Mssqlserver.jar

None of the above three files comes with standard JDBC driver download from Microsoft site. I tried downloading these jars manually from different locations, however they all have been removed. It just looks like these are very old and no longer used.

I was wondering if I still need these jars and env variables pointed to them for me to use the JDBC drivers for connecting to local MS SQL Server instance?

If answer to this question where can I find them?

Thanks.

回答1:

Use Microsoft JDBC Driver 4.0. Download here Microsoft JDBC Driver 4.0 for SQL Server

add sqljdbc4.jar to classpath in your project settings