I am unable to connect JDBC to my database, getting following error
Error : E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myprojectapplicati
According to the stacktrace, the MySQL Connector/J version you are using is using a java.util.regex.Matcher
feature not supported on Android (probably named groups). The workaround is to use a 5.1.x version of MySQL Connector/J instead of a 8.0.x version.
However, you shouldn't use JDBC from Android applications. It is insecure, and generally badly performing to connect to a database directly. The proper solution is to write a REST service (or other form of webservice) to mediate between your Android application and the database.
Probably means that the msql driver information in your configuration does not match the load driver in your code. The high version of the mysql driver registration, try to use this method: Class.forName("com.mysql.cj.jdbc.Driver");