How to set up Cloud SQL in Java
Written by Alistair Sykes
Mar 08, 2018

Setting up Cloud SQL in Java

Are you setting up Cloud SQL within a Java project using Android Studio? Read on - and hopefully we can point you in the right direction!

Cloud SQL

Cloud SQL is a fully-managed database service. It makes it easy to set up, maintain, manage and administer your relational MySQL database in the cloud:

The big switch

To set up our database we used a database management application for the easy interface ( I’m sure you’ll have your favourite way of setting up SQL databases. To interact with the database you need a connection:

Gradle dependency

compile ''​

A convenient util method


Once you have your database connection you can then perform operations utilising the standard Java APIs. We used it in combination with Google Cloud Endpoints. For more information on Cloud Endpoints take a look here. For example:

Next Post

User Authentication for Cloud SQL

Previous Post

Using Google Cloud Endpoints