Symptoms

Consider the following scenario:

  • You have a Java application that uses Microsoft SQL Server JDBC Driver version 3.0 and Java Runtime Environment version 1.7 (JRE 1.7) to connect to a SQL Server database.

  • The application uses any of the following functions to obtain a date from the database:

    • getDate()

    • getTimeStamp()

    • getDateTimeOffset()

  • The data type in the SQL Server database is DATE, DATETIME2, or DATETIMEOFFSET.

In this scenario, the function returns an incorrect date value.Notes

  • This issue occurs only when the date value that is returned by the function is more recent than the year 1582 in the Gregorian calendar.

  • This issue does not occur if the application uses one of the following combinations of components:

    • Microsoft SQL Server JDBC Driver version 3.0 and JRE 1.5 or JRE 1.6

    • Microsoft SQL Server JDBC Driver version 2.0 and JRE 1.7

Cause

The behavior of the functions that are described in the "Symptoms" section depends on the Java calendar APIs. Because of changes in the behavior of these APIs, Microsoft SQL Server JDBC Driver version 3.0 returns incorrect values.

Resolution

Microsoft SQL Server JDBC Driver version 3.0 was modified so that the functions that are described in the "Symptoms" section return correct values regardless of the JRE version. Microsoft JDBC Driver 4.0 for SQL Server will also contain this modification.

Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:

http://support.microsoft.com/contactus/?ws=supportNote The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.

Installation information

To install this hotfix, follow these steps.Windows

  1. Read the license.txt file for this hotfix.

  2. To accept this license agreement, download and use Microsoft SQL Server JDBC Driver version 3.0.

  3. Download and save the sqljdbc_<version>_enu.exe file in a temporary directory.

  4. Run the sqljdbc_<version>_enu.exe file.

  5. When you are prompted, enter an installation directory. We recommend that you unpack the compressed (.zip) files by using the following default directory:%ProgramFiles%\Microsoft SQLServer JDBC Driver 3.0

  6. After the package is unpacked, open the JDBC Help system by opening InstallationDirectory\Microsoft SQL Server JDBC Driver 3.0 \sqljdbc_<version>\<language>\help\default.htm. JDBC Help is displayed in the web browser.

UNIX

  1. Read the license.txt file for this hotfix.

  2. To accept this license agreement, download and use Microsoft SQL Server JDBC Driver version 3.0.

  3. Download and save the sqljdbc_<version>_enu.tar.gz file to a temporary directory.

  4. To unpack the compressed .gz file, locate the directory where you saved the file, and then type the following:gzip -d sqljdbc_<version>_enu.tar.gz

  5. To unpack the .tar file, move it to the directory where you want to install the driver, and then type the following:tar -xf sqljdbc_<version>_enu.tar

  6. After the package is unpacked, open the JDBC Help system by opening InstallationDirectory\Microsoft SQL Server JDBC Driver 3.0 \sqljdbc_<version>\<language>\help\default.htm. JDBC Help is displayed in the web browser.

Hotfix replacement information

This hotfix includes all previous hotfixes for Microsoft SQL Server JDBC Driver version 3.0.

File information

The global version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.

File name

File version

File size

Date

Time

Platform

Sqljdbc.jar

Not Applicable

518,294

08-Dec-2011

16:05

Not Applicable

Sqljdbc4.jar

Not Applicable

537,566

08-Dec-2011

16:05

Not Applicable

Xa_install.sql

Not Applicable

37,12

08-Dec-2011

16:05

Not Applicable

Sqljdbc_xa.dll

3.0.1301.203

253,744

08-Dec-2011

16:05

IA-64

Sqljdbc_xa.dll

3.0.1301.203

131,376

08-Dec-2011

16:05

x64

Sqljdbc_xa.dll

3.0.1301.203

102,192

08-Dec-2011

16:05

x86

Sqljdbc_auth.dll

3.0.1301.203

175,408

08-Dec-2011

16:05

IA-64

Sqljdbc_auth.dll

3.0.1301.203

87,344

08-Dec-2011

16:05

x64

Sqljdbc_auth.dll

3.0.1301.203

69,936

08-Dec-2011

16:05

x86

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.