Connect to Microsoft SQL Server via JDBC
This article describes how to get JDBC driver and write code for making database connection to Microsoft SQL Server from a Java client. Suppose you have a light weight version of SQL Server installed, such as Microsoft SQL Server 2012 Express . 1. Download Microsoft JDBC driver Click here to download Microsoft JDBC Driver 4.0 for SQL Server which supports: SQL Server versions: 2005, 2008, 2008 R2, and 2012. JDK version: 5.0 and 6.0. Run the downloaded program sqljdbc_<version>_<language>.exe . It will extract the files into a specified directory (default is Microsoft JDBC Driver 4.0 for SQL Server ). You will find two jar files sqljdbc.jar (for JDBC 3.0) and sqljdbc4.jar (for JDBC 4.0), plus some .dll files and HTML help files.Place the sqljdbc.jar file under your application’s classpath if you are using JDK 5.0 or sqljdbc4.jar file if you are using JDK 6.0 or later. 2. JDBC database URL for SQL Server The syntax of database URL for SQL Server is as follows: jd...

















Comments
Post a Comment