Microsoft JDBC Driver 4.0 for SQL Server

Source: Internet
Author: User
Tags how to connect to sql server microsoft sql server 2005 ssl certificate

One day before Microsoft released SQL Server 2012, it also released JDBC Driver 4 for SQL Server 2012, which is:

Http://www.microsoft.com/downloads/zh-cn/details.aspx? FamilyID = 49c554ca-41a0-472c-b728-75df5789213c

 

Changes from 3.0 to 4.0:

1765616 for katmai and later versions, DatabaseMetadata. getTypeInfo is now date, time,
Datetime2 and datetimeoffset return the new java. SQL. Type value.

1764334 added support for jdbc xa timeout and XID tracking.

1750318 the SQLServerDatabaseMetaData function can now work correctly when you repeatedly use the pool connection.

1768845 the behaviors of setTimestamp and updateTimestamp are consistent in terms of round-trip. The driver sends data
The server first rounds it to seven decimal places.

1770134 updateTime on the backend type of the time with the maximum value (23:59:59. 999) can now cause correct rounding behavior.

1761042 the DataSource Boolean attribute is now logged out of the call.

1750330 The xa SQL script is updated to avoid misleading errors during the first run.

1761393 improved tracking for the unwrap method.

1945579 DatabaseMetaData. getSchemas now works properly with SQL Azure and SQL Server for all sorting rules.

1963089 the hostNameInCertificate connection property is no longer required for SQL Azure to verify the SSL certificate.

1958531 if the server connection that is not set for the database image fails during login (for example, the database does not exist), the driver will not retry automatically.

1954701 the exception caused by inserting duplicate rows now includes SQLState 23000.

2055259 improved the error message when Integration authentication fails after sqljdbc_auth.dll is loaded.

2083373 if a large parameterized query using invalid parameters for SQL Azure causes an exception, the connection is not closed.

2084385 getDate, getTimestamp, and getDateTimeOffset now return the correct value of JRE 1.7 for all dates.

2105115 the getObject on the ResultSet obtained from DatabaseMetaData. getColumns can now work normally.

 

Note:

1. The running environment of Microsoft JDBC Driver 4.0 for SQL Server is Linux, Unix, Windows 7, Windows Server 2008 R2, and Windows Vista.

In other words, win2003 and XP are no longer supported.

2. The supported SQL Server versions are:

  • Microsoft SQL Server 2012
  • Microsoft SQL Server 2008 R2
  • Microsoft SQL Server 2008
  • Microsoft SQL Server 2005
  • Microsoft SQL AzureTM (new)

SQL Server 2000 and earlier versions are no longer supported. SQL Server 3.0/2000/2005 r2 is supported.(Http://www.microsoft.com/downloads/zh-cn/details.aspx? FamilyID = a737000d-68d0-4531-b65d-da0f2a735707)

 

Did a test, download Microsoft JDBC Driver 4.0 for SQL Server, and unzip, refer to this article http://www.cnblogs.com/downmoon/archive/2009/07/16/1524687.html, copy sqljdbc4.dll, to the JRE directory, and add reference.

Unexpectedly, the error message "cannot connect" appears in the DEMO program, prompting "unable to create a connection to the following URL: Jdbc: sqlserver: // ap2 \ vegnet: 1433; DatabaseName = Db2010Demo", My connection string is as follows:

Driver = com. microsoft. sqlserver. jdbc. SQLServerDriver
Sqlserver. url = jdbc: sqlserver: // ap2 \ vegnet: 1433; DatabaseName = Db2010Demo
Sqlserver. user = demo
Sqlserver. password = demo2012
Sqlserver. maxconn = 2000

Confirm that the user name and password are correct and the firewall is correct. Therefore, it is suspected that the new driver does not support connections with non-default instance names. In addition, the default instance of the server does not work. Later, I found that my SQL Server default port is not set,

For example:

 

Set the port and restart the SQL Server service. Connection successful !!

Other examples:

JDBC Driver For SQL2000/2005/2008

How to connect to SQL Server using windows integration in java

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.