Connect Google Cloud SQL

    Google Cloud SQL is a new service which runs mySQL databases in Google’s cloud. You can try out this service without charge until June 2013 under a introductory trial.

     

    Usually, you would need a cloud database to develop and run an applications with the Google App Engine platform. Of course, there should be a possibility to connect Cloud SQL from external applications. This is possible with the command line tool and via JDBC. Here comes the next use case for our QlikView JDBC Connector.

     

    To connect Google Cloud SQL you need to create OAuth 2.0 tokens to authorize applications to connect to your instance on your behalf. This can be done by using the command line tool (section Setup).

     

    After following the command line tool setup steps the OAuth 2.0 tokens are created and stores in Windows registry under the key:

     

    HKCU\Software\JavaSoft\Prefs\com.google.cloud.sqlservice

     

    You need to copy this entries for the user who will be running the application on the deployment machine.

     

    In the next step we configure the Google Cloud SQL JDBC driver in the connector:

     

    JDBCConfig_Google_Cloud_SQL.png

    Now we can start connecting Cloud SQL in QlikView. Just open the script editor choose JDBC Connector and click connect. Enter the JDBC connect string:

     

    jdbc:google:rdbms://<your_instance_name>/<your_database_name>?connector.driverClass=com.google.cloud.sql.Driver;

     

    Leave the user/password properties free.

     

    JDBCConnector_Google_Cloud_SQL.png

    Now we can select the objects from an example mySQL schema I’ve created before with the Google API Console SQL Prompt. Use the dialog as usual to build your SELECT statements to load the data into QlikView:

     

    JDBCConnector_Google_Cloud_SQL_select.png

    As we can see it takes only some additional configuration steps to connect QlikView with Google Cloud SQL. Then you can retrieve data into your QlikView application as you would work with a standard mySQL instance.

     

    - Ralf