简体   繁体   中英

I need to connect to Google cloud mysql using java but without using spring boot?

can someone help me with any sample working code or any project that I can look at? I have been searching this on google for few days but I always end up an answer with spring boot but I need to connect without using spring boot. I need to write automated API tests where I have to connect to cloud Sql fetch the data from Db and validate it.

As @siamsot mentioned, there is an article in the official GCP documentation on how to connect to a Cloud SQL instance.

Basically, you have the following options to connect to a Cloud SQL instance :

  • By using the proxy (Second Generation instances only)
  • By configuring access for one or more public IP addresses
  • By using the JDBC Socket Factory (for the Java programming language, Second Generation instances only)
  • By using the Cloud SQL Proxy library (for the Go programming language, Second Generation instances only)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM