SQL Server 2005 JDBC driver v1.2 Aug CTP is LIVE

The Microsoft SQL Server JDBC team is proud to announce the availability of our v1.2 CTP2 (beta) release.  The driver is downloadable at http://msdn.microsoft.com/data/jdbc.  The direct link to the download page is http://www.microsoft.com/downloads/details.aspx?FamilyID=f914793a-6fb4-475f-9537-b8fcb776befd&DisplayLang=en

In this CTP release, we added SSL encryption support to the driver on top of the Adaptive response buffering support available in CTP1.

Jimmy Wu, SQL Server
Disclaimer: This posting is provided "AS IS" with no warranties, and confers no rights

Comments (13)

Cancel reply

  1. SQL Server 2005 JDBC Driver 1.2 CTP August 2007公開

  2. Kevin Bean says:

    Have some problems with the sqljdbc.jar versions 1.1 and 1.2 with Vista.  If we use the jdk 1.4 we get the error "The SQL Server login requires an SSL connection."  If we use the jvm 1.6 we are able to get a connection.  Are there some know problems with Vista and this driver and different versions of the jvm?  Have narrowed down the code to the basic which I will now include.

    import java.sql.*;

    public class testSqlServer2 {


    * @param args


    public static void main(String[] args) {

    // TODO Auto-generated method stub

    try {


    Connection c = java.sql.DriverManager.getConnection("jdbc:sqlserver://localhost:1433;DatabaseName=mydb;user=testadmin;password=admin;SelectMethod=cursor ");

    System.out.println("We have connection!");

    } catch (Exception ex){






  3. Yesim says:

    Hi Kevin,

    Given your symptoms, I take it that your server forces encryption, i.e. does not allow unencrypted connections.

    MS SQL Server 2005 JDBC driver started supporting SSL only with v1.2 CTP2. Hence, if you are using any earlier version such v1.1 or v1.2 CTP1, you will not be able to connect to a server that forces encryption. This is by design.

    If you are using v1.2 CTP2, I have good news. We have just shipped v1.2 RTW which is available at the following link.


    To answer your question with respect to JDBC v1.2 RTW, failure to connect to a server that forces encryption is expected if you are using a JVM whose default JSSE provider does not support strong hash (i.e. certificate hash size > 4K) Some 1.4 JVMs fall into this category. Moving to later JVM versions would solve this issue.

    Hopefully this answers your question. Please follow up if you need more information.

    Additionally, assuming that you are using selectMethod=cursor to work around memory limitations in JDBC v1.1, I suggest you now use JDBC v1.2 feature responseBuffering=adaptive. This property is designed to replace selectMethod=cursor while boosting performance. You can read more about responseBuffering in the following blog article.



    Yesim [MSFT]

  4. sudhansu says:

    Hi Yesim  ,

    Recently I downloaded version 1.2 release of the Microsoft SQL Server 2005 JDBC Driver. Thanks a ton to Microsoft

    for providing many new features such as Adaptive Buffering , SSL Encryption , Tightly Coupled XA Transactions etc.

    I am mainly concerned about SSL part of it and would be grateful if you can solve my queries or forward it to app-

    ropriate forum.

    1 ) I tried connecting to SSL enabled SQL Server 2005 through a sample program provided by Microsoft along with this

       package ( Version 1.2 ) and I succeeded whereas in previous versions I use to get an exception as "The SQL Server

       login requires an SSL connection." My connection string is as follows "jdbc:sqlserver://Ip adress of dataserver

       machine:1433;databaseName=master;user=sa;password=sapassword" .

       Ideally we should only get an SSL connection when we request it else an error message should be thrown informing

       the user that dataserver requires an SSL connection. This would help in choosing between type of communication

       a user needs with dataserver.

       The scenario now is like forcing a user to have SSL communication if dataserver forces it. A flag may be added

       as ssl should be mandatory or auto .

    2 ) Current driver 1.2 is not capable of communicating with  MS SQL Server 2000 both in case of SSL and Non – SSL

       cases , The error which we receive in both cases is :

       Oct 18, 2007 4:57:17 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin

       WARNING:  ConnectionID:1 TransactionID:0x0000000000000000 Prelogin response packet not marked as EOM

       The TDS protocol stream is not valid.

       To communicate with both MS SQL Server 2000 and 2005 a user will have to maintain both the drivers which may

       increase complexity of the application , like loading both driver in a single process , etc etc . . .

       If version 1.2 id  built on top of Sql server 2000 JDBC drive then it should be able to handle following 4 cases :

       i   ) SQL Server 2005 – SSL  ,

       ii  ) SQL Server 2005 – Non – SSL  ,

       iii ) SQL Server 2000 – SSL  ,

       iv  ) SQL Server 2000 – Non – SSL  .

       If this single driver handles all above 4 cases , life of a developer and application developed by him/her would

       become less complex.

    3 ) Last but not the least , the SQL Server 2000 JDBC driver connects with both kind of SQL Server 2000 instances i.e.

       SSL and Non – SSL without any certificate of flags specified. I was able to establish non – SSL connection with SQL

       Server 2000 using two third party JDBC drivers which I think is not appropriate behaviour.

    4 ) I have also noticed that when SQL Server 2005 is running in Non – SSL mode i.e. "ForecEncryption=No" and our Client

       application requests SSL communication , we are not warned about server is not runnning in SSL mode , could you please

       explain this ?

    Kindly correct me I am wrong anywhere as I am just a beginner and don’t have much knowledge on this subject .

    Thanks a lot.

    Sincerly ,

    Sudhansu Tiwari

  5. Sudhansu Tiwari says:

    Please ignore 2 and 3 above. I Identified the issue related to 2 and 3 above , SP4 for SQL 2K wasn’t properly intstalled on my system , hence a re-installation did the trick. Thanks.

  6. dpblogs says:

    Hi Sudhansu,

    Thanks for you feedback.  I’m glad to hear that issue 2 and 3 have been resolved.

    Regarding question 1 in your feedback, we will take your request into consideration in a future release.  While we were designing the SSL support, we looked around the JDBC community and saw that there weren’t any standardized driver behavior around this.  We decided to error on the side of assuming the client application wanting to connect to the backend SQL Server without adding complexity to the already complex connection URL property list.

    Regarding question 4 in your feedback, the "ForceEncryption" setting used by SQL Server is control whether SQL Server will allow a non-SSL client connection.  When set to "No", SQL Server will support both a clear connection and a SSL connection.  When set to "No", if the client application requests SSL encryption, SQL Server will enable SSL encryption for the particular connection.  If the client application does not request SSL encryption, then a clear connection is established.

    Note: With SQL Server 2005 and the v1.2 JDBC driver, the user credentials is always encrypted using SSL (assuming proper JVM SSL configuration) to enhance security.

    Hope that answers your questions.


    Jimmy Wu [MSFT]

  7. Dafna says:


    I have downloaded the driver to install for SQL SERVER 2005 Express. sqljdbc_1.0.809.102_enu.exe

    But when I try to open it as instructed, I get an error message that the program is not a valid win32 application.

    Please Advise,



  8. Mugunthan says:

    Any reason you are donwloading the 1.0 driver. You should down load 1.2 driver.



  9. jim s says:

    Hi, I’ve compiled the sample Connect.java code and when tried to connect to SqlSever 2008 with the 1.2 sqljdbc jar I get the following error.

    C:webserverTomcat6webappsjkonfigWEB-INFclasses>java Connect Sep 9, 2008 11:14:18 AM com.microsoft.sqlserver.jdbc.TDSChannel enableSSL

    WARNING: TDSChannel ( ConnectionID:1 TransactionID:0x0000000000000000) SSL handshake failed: RSA pre

    master secret error

    com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection

    to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: RSA premaster secret error.

           at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)

           at com.microsoft.sqlserver.jdbc.TDSChannel.throwSSLConnectionFailed(Unknown Source)

           at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(Unknown Source)

           at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)

           at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)

           at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)

           at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)

           at java.sql.DriverManager.getConnection(DriverManager.java:582)

           at java.sql.DriverManager.getConnection(DriverManager.java:185)

           at Connect.getConnection(Connect.java:33)

           at Connect.displayDbProperties(Connect.java:55)

           at Connect.main(Connect.java:102)

    Error Trace in getConnection() : The driver could not establish a secure connection to SQL Server by

    using Secure Sockets Layer (SSL) encryption. Error: RSA premaster secret error.

    Error: No active Connection

    Any idea why? Force encryption is turned off and server athenication is turn on. This is driving me crazy. Sample code and lastest version of everything. java 1.6, sqlserver 2008, sqljdbc1.2, Vista.

    thanks any help would be greatly appreciated.

    jim s

  10. dpblogs says:

    Hi Jim S,

    We’ve posted a general SSL connectivity troubleshooting blog post which you can find here (http://blogs.msdn.com/jdbcteam/archive/2008/09/09/the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption.aspx).

    Our past experience typically point us to some modified JSSE configuration.  Please follow the information in the blog post to verify the JSSE providers are correct.



  11. markvl says:

    Hi Jimmy,

    We are using the JDBC driver to a mirrored SQL Server 2005 setup.

    Recently we had a case where the client failed to connect when there was a failover.

    com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: SQL Server did not return a response. The connection has been closed..

    com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: SQL Server did not return a response. The connection has been closed..

    This error has not occurred on other occasions where the DB has failed over, both before and after the above incident.

    We are concerned that the JDBC handling of failovers is unreliable.

    Environment is:

    JDBC sqljdbc_1.2.2828.100_enu


    Red Hat 5.1

    Any comments?


  12. Miguel Oliveira says:


    My trying to connect to SQL Server 2005 from a UNIX machine but I get an error.

    The configuration setings that I use are:



    The eror message is:

    Failed to open input block: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown.

    Any one can help?




Skip to main content