Resolution record of SQL Server database connection problem in MyEclipse

December 12, 2016 2290 point heat 4 people like it 0 comments


Com.microsoft.sqlserver.jdbc.SQLServerException: 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".


This historical legacy has a long history, and the contents on the Internet are similar to each other. The solutions to the problems are also various, but they all end up with unclear answers. The audience is also confused. The blogger also encountered this problem, but it has not been solved for a long time. This article is only for recording, in case of emergency.

1. The file was replaced according to what was said on the Internet, but it still could not be solved

http://blog.csdn.net/u012557538/article/details/52010359

The elder brother said it clearly. He tried this once, but he still couldn't do it. Finally, he understood the problem.

Fang General Plan:

Download two jar packages -------------------->bcprov-ext-jdk15on-1.54.jar and bcprov-jdk15on-1.54.jar

The download address is: http://download.csdn.net/detail/cw_hello1/9557049

Step 2: Copy the two downloaded JAR files to the JDK installation directory jre lib ext. For example, my file 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 replaced

security.provider.1=org.bouncycastle.jce.provider.BouncyCastleProvider

Let's start with my test environment: windows10+MyEclipse 8.6+SQLServer2012,

The first time I encountered this problem, I suddenly couldn't connect to the database. I immediately searched the Internet and saw the previous article on CSDN, the one mentioned at the beginning. I thought it was so simple. I found the shortcut of the software in the menu according to the author's idea, opened the installation directory of MyEclipse 8.6, and then completed the operation step by step, But the result is that the problem still exists, which makes me puzzled~

Finally, I realized that it was wrong from the beginning (once again proved the importance of English)

The correct way is to open MyEclipse 8.6, and then open Windows, Preference,Java,Installed JRE, Select JDK and click Edit

Get the path C: Users user name AppData Local Genuitec Common binary com.sun.java.jdk.win32.x86_1.6.0.013

Then perform the above operations in this folder

Finally, restart the computer! Restart the computer! Restart the computer! (Tell important things three times)

Refer to the following figure:

Figure 1

Figure 2

Figure 3

Extract password: Gcod

Two jar packages used in the article Size: | Source: Enterprise cloud disk
The security software has been tested to be non-toxic. Please be assured to download it.

Gcod

If life is just like the first sight, what is the sad autumn wind painting fan

Article comments