Go to: blog.csdn.net/ying5420/article/details/4488246
1.SQL SERVER 2000
JDBC Driver: Msbase.jar, Mssqlserver.jar, Msutil.jar. All three files can be downloaded from Microsoft's official website and are essential for connecting SQL SERVER 2000 in Java development.
Driver:com.microsoft. jdbc . SQL Server . SQLServerDriver
URL:jdbc :Microsoft :SQL Server://localhost:1433; Databasename=test
The default connection port for SQL SERVER 2000 databases is 1433, and when used, the appropriate modifications are made to the actual situation.
2.SQL SERVER 2005
JDBC Driver: Sqljdbc.jar. The 2005 version of the database only needs this one jar file, also can be downloaded from the official Microsoft website.
Driver:com.microsoft. SQL Server . jdbc . SQLServerDriver
URL:jdbc:sqlserver ://localhost:1433; Databasename=test
Note here that the color font, SQL Server 2005 and SQL Server 2000 connection is slightly different, the software development must be based on the version of the SQL Server database to write to the connection method, otherwise it is not possible to successfully connect to the database.
3.SQL SERVER 2008
So far, Microsoft seems to have not released this version of the database-specific drivers, so the general development of SQL SERVER 2005 is replaced by the driver. However, it is important to note that the connection port for SQL SERVER 2008 is not statically bound to a port, and differs from previous versions, and it uses a mechanism for dynamic ports. Therefore, when using the database in real development, it is important to disable its default dynamic port mechanism, bind it on a port, or it will report a failure to connect to the database. After you disable dynamic ports, you can use the SQL Server 2005 driver and then connect as a JDBC connection for SQL Server 2005.
How JDBC connects to each version of SQL Server