Topic
  • 2 replies
  • Latest Post - ‏2018-11-29T13:28:24Z by Ran-J1
Ran-J1
Ran-J1
2 Posts

Pinned topic How do I connect SQL Server with IBM JDK 8?

‏2018-11-17T04:19:56Z | sqlserver

My application run on Suse Linux with IBM JDK 8 & liberty . The code is

        Connection con=DriverManager.getConnection("jdbc:sqlserver://xx.xx.xx.xx:1433;DatabaseName", "user", "password");
        Statement sta=con.createStatement();
        String sql="select * from table";

The console print the error message everytime ,I import the mssql-jdbc-7.0.0.jre8.jar 

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server returned an incomplete response. The connection has been closed

If I change the jdk from IBM to Oracle ,the application will be run . How do I connect sqlserver with IBM JDK?

The JDK version is

java version "1.8.0" Java(TM) SE Runtime Environment (build pxa6480sr3fp12-20160919_01(SR3 FP12))

IBM J9 VM (build 2.8, JRE 1.8.0 Linux amd64-64 Compressed References 20160915_318796 (JIT enabled, AOT enabled)

J9VM - R28_Java8_SR3_20160915_0912_B318796

JIT - tr.r14.java.green_20160818_122998

GC - R28_Java8_SR3_20160915_0912_B318796_CMPRSS

J9CL - 20160915_318796)

JCL - 20160914_01 based on Oracle jdk8u101-b13

 

Updated on 2018-11-17T04:42:06Z at 2018-11-17T04:42:06Z by Ran-J1
  • Ran-J1
    Ran-J1
    2 Posts
    ACCEPTED ANSWER

    Re: How do I connect SQL Server with IBM JDK 8?

    ‏2018-11-29T13:28:24Z  

    Sounds like the JSSE2 provider from IBM uses TLS defaults which the SQL Server does not like. IS thata recent SQL Server installation? Maybe try to remove some of the disabled algorithms in the `java.security` properties or check the SQL Server log for ejected messages and their explanation.

    Thank you 

    The answer is add a tls version jdbc:sqlserver://xx.xx.xx.xx:1433;DatabaseName=databasename;sslProtocol=TLSv1.2

  • BerndEckenfels
    BerndEckenfels
    2 Posts

    Re: How do I connect SQL Server with IBM JDK 8?

    ‏2018-11-27T04:24:05Z  

    Sounds like the JSSE2 provider from IBM uses TLS defaults which the SQL Server does not like. IS thata recent SQL Server installation? Maybe try to remove some of the disabled algorithms in the `java.security` properties or check the SQL Server log for ejected messages and their explanation.

  • Ran-J1
    Ran-J1
    2 Posts

    Re: How do I connect SQL Server with IBM JDK 8?

    ‏2018-11-29T13:28:24Z  

    Sounds like the JSSE2 provider from IBM uses TLS defaults which the SQL Server does not like. IS thata recent SQL Server installation? Maybe try to remove some of the disabled algorithms in the `java.security` properties or check the SQL Server log for ejected messages and their explanation.

    Thank you 

    The answer is add a tls version jdbc:sqlserver://xx.xx.xx.xx:1433;DatabaseName=databasename;sslProtocol=TLSv1.2