0

class.forname("java.sql.jdbc.Driver") throws the Unhandled exception error: java.lang.ClassNotFoundException. Library added, paths in build.gradle is spelled out the error does not disappear at all. I tried to find similar topics, but I didn't find anything. I don't understand how this can be fixed, maybe someone knows how to solve this problem?enter image description hereenter image description here

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
  • 1
    There is no such class called `java.sql.jdbc.Driver`, so obviously it throws a ClassNotFoundException. You probably meant `com.mysql.cj.jdbc.Driver` (or the deprecated `com.mysql.jdbc.Driver`). However, you really should not use a JDBC driver from Android (recent drivers are unlikely to work as they use features not available on Android, it is not very secure and can have performance problems). Use a REST service to mediate between your application and the database. – Mark Rotteveel Feb 12 '22 at 11:32

0 Answers0