In the blink of an end, Java 11 is almost ready to roll.
And I have been in the Java 7 environment to write code, really do not want to upgrade, do not want to change anything, the world is changing every day.
Recently, because the server needs SNI, and Java 7 only support the client's SNI, only upgrade to Java 8 to use the service side of SNI, I am afraid to upgrade to Java 8, the original code is affected, I found a computer installed in the normal use of Java 8.
Ran a bit of code, and sure enough to encounter the problem: ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver
Online search for the relevant information, said that JDK8 removed the Jdbc-odbc bridge (starting from Java 8, JDBC-ODBC Bridge will no longer be included in the JDK.) ), and then find a solution: extracting JDBC from Java 7
1. Download JDK 7 or JRE 7.
2. Go to the JRE \ Lib folder and locate Rt.jar
3. Unzip it (if you have WinRAR or 7zip installed), or you can rename it to Rt.zip and unzip it.
4 Copy the Sun \ JDBC and Sun \ Security \ Action folders, preserving the folder structure. That is, you should have the following folder structure:
Sun--Security--Action
Sun-To-JDBC
5. Open a CMD window. Go to the parent folder of the Sun folder. Run command: JAR-CVF Jdbc.jar Sun
6. The above command will create a file named Jdbc.jar
7. Copy the Jdbc.jar to your JDK8 or JRE8 lib folder. If this doesn't work, try using the Lib\ext folder.
8. Copy Jdbcodbc.dll from JRE \ Bin installed on JRE 7 to the JRE \ Bin installed in JRE 8.
9. Restart your JVM.
Source:
Https://stackoverflow.com/questions/14229072/removal-of-jdbc-odbc-bridge-in-java-8
Http://bigfatball.blogspot.com/2016/03/how-to-enable-jdbc-odbc-bridge-for-jdk-8.html
Java 8:classnotfoundexception:sun.jdbc.odbc.jdbcodbcdriver