问题
I am developing an android app, which connects to a mysql server that was working, but now a java.lang.ClassNotFoundException error: Didn't find class "java.sql.SQLType". I don't know what happened, the only things I changed was the version of the mysql connector, and the computer I was working on, please help me.
Edit Sorry for the lack of information about the project, but I never know what is needed to help discover the problem. I am using gradle, with java 1.8 and Android SDK 9.0 (Pie)
回答1:
Although I could not discern from the problem description any details of the project setup/env(gradle/maven?)- the issue seems to be the driver for the connector specified could not be found. In general any connection changes made recently may require an updated jar/sql driver or you need to double check if the project classpath has one that does indeed contain the implementation of the offending class.
In the case of java.sql.SQLType, it was apparently introduced in Java 1.8 - could you check if the compile is being performed on 1.8 minimum or if the java version being used by your IDE to compile reverted to 1.7
回答2:
Apparently it has to do with the mysql connector, I downgraded it to the old version (5.1.46) and it worked, but thanks for the help.
来源:https://stackoverflow.com/questions/59866169/java-classnotfoundexception-java-sql-sqltype-in-mysql-connection