GoogleDriver not loading

Hi Team,

I am currently facing with the connectivity to Cloud SQL in our Java App Engine application. I have encountered the following error message. 

String jdbcUrl = String.format("jdbc:mysql://google/%s?cloudSqlInstance=%s&socketFactory=com.google.cloud.sql.mysql.SocketFactory&user=%s&password=%s", DATABASE_NAME, INSTANCE_CONNECTION_NAME, USERNAME, PASSWORD);

error with this code: "Could not initialize class com.google.cloud.sql.mysql.SocketFactory"

Error Msg: "java.lang.ClassNotFoundException: com.mysql.jdbc.GoogleDriver"

 

0 1 80
1 REPLY 1

Facing the error after upgrading java8 to java17.

<?xml version="1.0" encoding="utf-8"?><appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>myapp</application>
<version>myapp1</version>
<runtime>java17</runtime>
<threadsafe>true</threadsafe>
<app-engine-apis>true</app-engine-apis>
<sessions-enabled>true</sessions-enabled>
<use-google-connector-j>true</use-google-connector-j>
<module>default</module>
<instance-class>B2</instance-class>
<basic-scaling>
<max-instances>5</max-instances>
<idle-timeout>5m</idle-timeout>
</basic-scaling>
</appengine-web-app>