Hi,
I have been trying to connect a glassfish server to Cloud MySQL server, I'm trying to setup the pool using cloud-sql-jdbc-socket-factory but I have hade no luck, has anybody managed to setup a connection pool using cloud-sql-jdbc-socket-factory
Any help would be appreciated.
Thanks,
Hi @marcord,
Connecting a Java application server like GlassFish to a Cloud SQL for MySQL instance is supported through several secure methods. One of the recommended approaches is using the Cloud SQL Java connector with the cloud-sql-jdbc-socket-factory
, which manages secure connections without requiring IP allowlists or SSL certificates. You can review the available connection methods in the Cloud SQL connection overview.
To assist with configuration, this servlet example demonstrates how to connect using the socket factory in a Java environment. Additional Java code samples may also be useful for reference. For setting up JDBC connection pools in GlassFish, refer to the JDBC chapter of the GlassFish Application Development Guide, along with the GlassFish Server Administration Guide and Quick Start Guide. If you need more help, you can consider opening a new issue on the Cloud SQL GitHub.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.