Tutorial :Which jar to use for connecting to MS SQL server



Question:

Can some one please guide me to understand which jar file i need to include in my application to be able to set up a jdbc connection with ms sql server.

thanks in advance.


Solution:1

sqljdbc.jar and sqljdbc4.jar class library files to be used depending on your preferred Java Runtime Environment (JRE) settings. For more information about which JAR file to choose, see System Requirements for the JDBC Driver.

Downloads links and more information can be found here.


Solution:2

You can use jtds jar, you will also need to add the dll/so to you java library path.

EDIT: More recent release


Solution:3

The Microsoft SQL Server JDBC Driver version 2.0 provides sqljdbc.jar and sqljdbc4.jar class library files to be used depending on your preferred Java Runtime Environment (JRE) settings.

sqljdbc4.jar class library requires a Java Runtime Environment (JRE) of version 6.0 or later.


Solution:4

Microsoft started publishing their Driver JARs to the central Maven repo in 2017. See Maven Search for the available versions.

<dependency>      <groupId>com.microsoft.sqlserver</groupId>      <artifactId>mssql-jdbc</artifactId>      <version>7.0.0.jre10</version>  </dependency>  


Solution:5

http://www.microsoft.com/downloads/details.aspx?FamilyID=99B21B65-E98F-4A61-B811-19912601FDC9&displaylang=en

MS JDBC Driver. Has documentation.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »