How to connect to Google Spanner through MicroStrategy Web and Developer using a JDBC driver Associate Scrum Master • Strategy
Share
This article explains how to connect to Google Spanner in MicroStrategy Web and MicroStrategy Developer Setup Download the JDBC Driver for Google Cloud Spanner. The environment variable GOOGLE_APPLICATION_CREDENTIALS is checked. If this variable is specified it should point to a file that defines the credentials. The simplest way to get a credential for this purpose is to create a Service account key in the Google API Console:
Go to the API Console Credentials page. From the project drop-down, select your project. On the Credentials page, select the Create credentials drop-down, then select Service account key . From the Service account drop-down, select New Service Account . Name the service account and select Role as Project Owner from the drop down. For Key type , select the JSON key option, then select Create . The file automatically downloads to your computer. Put the *.json file you just downloaded in a directory of your choosing. Set the System Environment Variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file downloaded. Connect Google Spanner to Strategy Web via JDBC Driver
Open Strategy Web and click Add External Data . Select any of the 3 presented options(Build a Query, Type a Query, or Pick Tables). Click Add link in the top right of the Data Sources pane. Fill out the data source information:
Select Database as Generic Select Version as Generic DBMS Click Show Connection String Check Edit Connection String Enter the connection string(query example shown below)
JDBC;DRIVER=com.simba.cloudspanner.core.jdbc42.CloudSpanner42Driver;URL={jdbc:cloudspanner://localhost;Project=Strategyspannerproject;Instance=test-instance;Database=example-db};driverFile=CloudSpannerJDBC42.jar;MSTR_JDBC_JAR_FOLDER=C:/Drivers; The entered connection string consists of the following:
DRIVER = The Driver name as given in the Simba JDBC Driver Config Guide.URL = Consists of three parameters(Project,Instance and Database) Update these three parameters as per the project.driverFile = Name of the driver jar fileMSTR_JDBC_JAR_FOLDER = Local folder where the jar is stored.
Enter dummy values for user and password Enter a Data Source Name and click OK. The Data Source should now connect and show INFORMATION_SCHEMA in the Available Tables list on the left. Click on the settings (Catalog SQL) icon in the top right of the Available Tables pane. Select "All" under Namespaces and click Ok to see the list of all tables.
Connect Google Spanner to Strategy Developer via JDBC Driver
Open Strategy Developer > Strategy Analytics Modules > Administration > Configuration Managers > Database Instances Right click on the screen > New > Database Instance
Name database instance "spanner" Database connection type: Generic DBMS
Click New to add a Database connection and name the Database instance as spanner . Select any Default database login name if none selected or create dummy credentials by clicking on New .
Select the Advanced tab and enter the connection string in Additional connection string parameters:
The parameters of the connection string are as follows:
DRIVER = The Driver name as given in the Simba JDBC Driver Config Guide.URL = Consists of three parameters(Project,Instance and Database) Update these three parameters as per the project.driverFile = Name of the driver jar fileMSTR_JDBC_JAR_FOLDER = Local folder where the jar is stored.Click OK which will redirect to the General tab. Select the newly created database connection from the list and click OK . Select your Project from the Folder List on the left. On the top, click on Schema > Warehouse Catalog Select current database instance: Select "spanner" from the drop down menu.
You should be able to see the Database Catalog . Right click on any table and select Table Structure to view the Table Schema.
Right click on any table and select Show sample data to view sample content.