Since JDK6 must be used as the Java environment in the project, com.microsoft.sqlserver.jdbc.SQLServerException occurred when connecting to SQL Server: The driver cannot establish a secure connection with SQL Server by using Secure Sockets Layer (SSL) encryption. Error: " Java.lang.RuntimeException : Could not generate DH keypair". such a mistake.
This is fixed in JDK7, so if the project allows it, replace it with JDK7, but what should I do if some projects that can only use JDK6 encounter this situation?
first step:
Download two jar packages ---------------------
bcprov-ext-jdk15on-1.54.jar和bcprov-jdk15on-1.54.jar
Step 2: Copy the two downloaded JAR files to: JDK installation directory\jre\lib\ext, for example, mine is F:\JDK\jdk6\jre\lib\ext
Open the java.security file: the java.security file under the JDK installation directory \jre\lib\security.
Find security.provider.1=sun.security.provider.Sun and replace it with
security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider
Re-execute the connection database program
I solved this problem using the first method
http://www.cnblogs.com/shuilangyizu/p/6003858.html
You can also refer to this URL:
http://blog.csdn.net/cw_hello1/article/details/51740893