Microsoft JDBC Driver 4.0 for SQL Server Released!

Dear SQL Server Developer Community,

I am pleased to report that the Microsoft JDBC Driver 4.0 for SQL Server is now released.  Thank you for all your great feedback on our three community technology previews (CTP).  Our 4.0 release contains some great features which I would like to highlight.

Pure Java Kerberos

Customers using non-Windows platforms now have the option of using Kerberos for authentication.  The table below summarizes available authentication options.




Pure Java Kerberos


SQL Server


Pure Java Kerberos


SQL Server


Kerberos with NTLM backup




We have several customers who have tested Kerberos via our CTP driver, some using Linux in a cross-realm environment.

Always On

The Microsoft JDBC Driver 4.0 for SQL Server supports AlwaysOn high availability and disaster recovery.  Customers have the option to use AlwaysOn instead of database mirroring. 
Some key features include

  • Ability to specify whether an application is connecting to an AlwaysOn Availability Group Cluster (multi subnet failover)
  • Ability to specify application intent as read only vs. read/write

Correlated Tracing with XEvents

SQL Server 2012 introduces a user interface for XEvents and users can choose to track driver related actions within XEvents.  Simply set appropriate parameters for logging, create an XEvents session and the Microsoft JDBC Driver 4.0 for SQL
Server will send tracing information to XEvents to enable troubleshooting and monitoring.  The correlation information will be available in all XEvent targets including in memory, the XEvents ring buffer, log files, and the viewer in management studio.

FormatID change in XA Transactions

Based on customer and partner feedback, we made a change to the way the FormatID field is handled in XA transactions.  The Microsoft JDBC Driver 4.0 for SQL Server will now use the provided formatID field in all XA transactions.

Other features

Other features include UTF-16 support, enhanced SQL Azure support, support for sparse columns,and bug fixes.

Documentation, Feedback and Download

You can find documentation on the driver at our MSDN documentation page, obtain technical support via our forums or Microsoft Customer Support, report bugs via the SQL Server Connect Site, and (most importantly!) download the new driver here.

Thank you for your support and we look forward to your feedback.

Shamitha Reddy

Program Manager - Microsoft JDBC Driver for SQL Server

Comments (21)
  1. jezter says:

    Please, make it available via Maven Central.

  2. fsdba says:

    Hi – We are trying to setup widows authentication from Linux(SUSE) box to SQL 2K8 backend. Is there a case studyKB which has step to step guide on how to achieve this?

    We are using JDBC4.0 driver.

  3. @fsdba  If you are running on SUSE Linux you can authenticate using pure Java Kerberos or SQL Server Authentication.  You can only use Windows authentication if you are running the JDBC Driver on the Windows platform.

  4. fsdba says:

    Hi – Is ther any Documntation/case study/KB article on how to use Java Kerberos on Linux Suse environment?

  5. @fsdba

    The following topic covers Kerberos setup for WIndows, Linux, and other non-Windows environments.…/gg558122.aspx

  6. mv288 says:

    One of the major complaints against using the MSSQL driver over jTDC was the performance. A developer in this post reports Microsoft driver is 50% slower than JTDC.…/why-is-jtds-faster-than-microsoft-jdbc-driver

    Any comment on performance improvements in this new version?

  7. mv288 says:

    correction: It is jTDS not jTDC/JTDS.

  8. @mv288

    Thanks for your feedback. We are continuously looking at ways to improve the performance and scalability of the Microsoft JDBC Driver for SQL Server. Would you like to provide us with more specifics via our blog contact page?…/contact.aspx

    Also, have you compared our latest driver – Microsoft JDBC Driver 4.0 for SQL Server using SQL Server 2012 with jTDS?

    I responded on Stack Overflow as well.

  9. brendanh says:

    Can Microsoft conduct its own head-to-head performance tests against jTDS?

    The conventional wisdom in the Java dev community is that when supporting SQL Server from Java,  jTDS is the choice, because Microsoft's JDBC implementation has a reputation of being slow and buggy.

    However jTDS is ageing – its last release was over 2 years ago – whereas Microsoft have been steadily releasing new versions. It might be time for this conventional wisdom to be updated?

    There is an opportunity for Microsoft to fill the information void comparing jTDS and its own driver, in terms of both stability and performance.



  10. @brendanh

    The feedback that jTDS is faster than the Microsoft JDBC is mainly anecdotal.  We have on numerous occasions asked for additional details regarding how the tests were conducted and have not received those details.

    The key with performance benchmarking is to ensure that products are being compared equally (apples to apples instead of apples to oranges).  We have heard that jTDS handles Secure Sockets Layer (SSL) communication differently from the Microsoft JDBC Driver.  If the performance tests do not take into account these differences, the test results may be skewed.

    We would be happy to partner with the community to conduct performance benchmark testing.  Keep in mind that one needs written approval from Microsoft prior to publishing any results (see section 2 of our software license).

    With regards to bugs in the Microsoft JDBC driver, every software product on the market will have some bugs.  We encourage our users to report bugs via Microsoft Connect and also encourage the community to vote on those bugs so we can understand how many individuals are impacted by a particular bug.  We carefully review every bug report we receive.  We look at various variables including whether a workaround exists, if a fix can be made without impacting backward compatibility and then determine a course of action for that bug.

    When choosing a driver, here a few points to consider

    –  How does the driver handle security including SSL communication?  The Microsoft JDBC Driver is subjected to extensive Corporate security reviews at each release.

    –   How active are the forums?  We have a very active forum that offers free community support.  Other Microsoft JDBC users & MVP's frequently answer forum posts.  In addition our forums are monitored by Microsoft Customer Support and the Microsoft Product Group.  The forums are easily searchable on the internet and MSDN.

    –  Is paid support available?  Support is available for our driver via Microsoft Customer Support.  In addition, Customer Support and the Product Group have frequent communication on customer cases.

    –  Does the driver support new SQL Server releases/features?  The Microsoft JDBC Driver 4.0 supports SQL Server 2012 along with Always On and XEvents.  We strive to support new functionality in SQL Server, SQL Azure, PDW, and other Microsoft offerings.

    –  Is the driver adding new features regularly?  We released the 4.0 version of the driver in March 2012 that included pure Java Kerberos support, a FormatID change (requested by customers & partners), and other features.  We are looking forward to future releases of the driver so we can continue to expand on our driver's functionality.

  11. I'm confused about this annoucement.  I have a sqldjbc4.jar that is internally dated to 4/19/2010.  It appears to be from Microsoft and it works.  How is does my older version differ from this newer release?

  12. I just tried out this newer release. My older version worked fine from my Java application. However, the new version generates the following error "SQL Server version 8 is not supported by this driver. ClientConnectionId:92d3a68d-f3db-4442-a6b0-115dfa86811f".  Why is this happening?

  13. Hans Castorp says:

    The driver does not support running with "SET SHOWPLAN_ALL ON;"

    As soon as that is turned on, every select statement throws an exception with:

    The TDS protocol stream is not valid. Unexpected token TDS_COLMETADATA (0x81). [SQL State=08S01]

    Driver version: 4.0.2206.100

    Happens with SQL Server 2012 Express and SQL Server 2005 SP3

  14. Hans Castorp says:

    More details on the problem: the driver only throws an exception when setMaxRows() is called on the statement object before running the statement to be explained.

  15. Matthew Adams says:

    Great!  Now can you please publish it to Maven Central?…/db43206a-756c-4291-9c67-e813d18bdbf5

  16. Deivid says:

    Please upload it in maven central!

    Because if you don't upload it there, every developer that use any project with SQL Server JDBC Driver need to set this configuration in a local repository.


  17. yacjap says:

    am using jvm 6, but the bug off the date (date-1day)  still present and this time it's very

    hazardous befor it was beter for all the date you have just to add one day but now sometimes the date show corectly and sometimes not

    please fixe this  bugs

  18. ajay says:

    Please, make it available via Maven Central.

  19. Marcin says:

    does jdbc 4 support sql 2014 in-memory tables or stored procedures?

  20. The Damn Download Link Is Not Working says:

    Hi there,

    I would love to download your JDBC driver, but the damn link isn't working….it just brings up a blank white page:…/details.aspx

    It's been like this for the last two days.  Please fix.


  21. Pawel1986 says:

    Trying to integrate SQL Server with Java application running on Glassfish turned out to be a complete failure. It is working great with MySQL but trying to connect it with JDBC (sql4jdbc.jar) to SQL Server is literally a nightmare!

    Here is very detail description of the problem:…/invalidkeyspecexception-on-deploying-ear-file-containing-entitybeans-and-using

    … But in a short, all I get from this "Integration exercise" is this entry in a Glassfish log file:

    Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Server key". ClientConnectionId:a3f21831-fbc0-491c-9691-2b28500d7d2b

    Error Code: 0. Please see server.log for more details.

    … Apparently caused by: Caused by: Unknown KeySpec type:

    No idea what to do.

Comments are closed.

Skip to main content