Java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver error reporting solution
Error report description problem description cause analysis solution operation results
Error reporting description
java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver reports an error
Problem description
when learning the contents of Java database, because the old version of teaching materials are used, and the Java version has been updated and some functions have been deleted, an error message prompted by java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver appears when reading the database:
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (ClassNotFoundException e) {
System.out.println(e);
}
Error message: java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver
Cause analysis
since JDK1.8, the JDBC ODBC bridge has been deleted, so the ODBC driver cannot be used </ font>
Solution
-
- Step 1: install the old version of JDK. I install the download link of version 1.7 here: just click the next step for the jdk1.7 installation step. Step 2: change the Java environment
-
- friends using eclipse can refer to this blog:
-
- java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcodbcdriver solution 2.1 I use the integrated development environment of idea, The method is as follows:
-
- in file – project structure
-
- in project settings, select the JDK version downloaded for you by project SDK (here is 1.7)
-
- and click apply to run
Operation results
run smoothly ^ ^
Read More:
- [Solved] Tomcat Server Error: java.lang.NullPointerException Csonsole Error ClassNotFoundException: com.mysql.jdbc.Driver
- [Solved] SSM startup error: ClassNotFoundException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- [Solved] Error setting driver on UnpooledDataSource. Cause: java.lang.ClassNotFoundException: Cannot find cla
- [Solved] Java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
- [Solved] Maven Project Error: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- [Solved] IDEA Error(15, 16) java Program Pack sun.misc does not exsit or import sun.misc.BASE64Decoder Cannot find
- [Solved] Hibernate Error: java.lang.StackOverflowError at java.lang.Integer.toString(Integer.java:402)
- [Solved] Java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.util.List
- [Solved] nacos Startup Error: nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error
- [Solved] com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure error
- Extracting JDBC tool class: JDBC utils
- [Solved] JAVA fx Error: java.lang.instrument ASSERTION FAILED ***: “!errorOutstanding“ with message transform
- [Solved] Java 9 reflection error: java.lang.reflect.InaccessibleObjectException
- [Solved] java: Internal error in the mapping processor: java.lang.NullPointerException
- [Solved] JAVA Project Import jstl Error: java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/TagLibraryValidator
- [Solved] JAVA OpenCV Startup Error: java.lang.UnsatisfiedLinkError
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- [Solved] java Internal error in the mapping processor java.lang.NullPointerException
- JAVA error: java.lang.OutOfMemoryError:GC overhead limit exceeded
- [Solved] Hbase-shell 2.x Error: Unhandled Java exception: java.lang.IncompatibleClassChangeError: Found class jline.Terminal…