How JDBC connects to each version of SQL Server

Source: Internet
Author: User
Tags microsoft website

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.