EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

How to connect to Google Spanner through MicroStrategy Web and Developer using a JDBC driver


Norman Matos

Associate Scrum Master • Strategy


This article explains how to connect to Google Spanner in MicroStrategy Web and MicroStrategy Developer

Setup

  1. Download the JDBC Driver for Google Cloud Spanner.
  2. 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:


 

  1. Go to the API Console Credentials page.
  2. From the project drop-down, select your project.
  3. On the Credentials page, select the Create credentials drop-down, then select Service account key.
  4. From the Service account drop-down, select New Service Account.
  5. Name the service account and select Role as Project Owner from the drop down.
ka044000000kPBkAAM_0EM440000002RsR.png
  • 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.
ka044000000kPBkAAM_0EM440000002RsW.png

Connect Google Spanner to Strategy Web via JDBC Driver


 

  1. Open Strategy Web and click Add External Data.
  2. Select any of the 3 presented options(Build a Query, Type a Query, or Pick Tables).
  3. Click Add link in the top right of the Data Sources pane.
  4. Fill out the data source information:


 

  1. Select Database as Generic
  2. Select Version as Generic DBMS
  3. Click Show Connection String
  4. Check Edit Connection String
  5. Enter the connection string(query example shown below)


 

  1. 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;
  2. The entered connection string consists of the following:


 

  1. DRIVER = The Driver name as given in the Simba JDBC Driver Config Guide.
  2. URL = Consists of three parameters(Project,Instance and Database) Update these three parameters as per the project.
  3. driverFile = Name of the driver jar file
  4. MSTR_JDBC_JAR_FOLDER = Local folder where the jar is stored.


 

  1. Enter dummy values for user and password
  2. 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.  
  3. Click on the settings (Catalog SQL) icon in the top right of the Available Tables pane.
  4. Select "All" under Namespaces and click Ok to see the list of all tables.

 

ka044000000kPBkAAM_0EM440000002MDb.png


 

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

ka044000000kPBkAAM_0EM440000002Rsv.png


 

  • Name database instance "spanner"
  • Database connection type: Generic DBMS
ka044000000kPBkAAM_0EM440000002Rt0.png


 

  1. Click New to add a Database connection and name the Database instance as spanner.
  2. Select any Default database login name if none selected or create dummy credentials by clicking on New.

 

ka044000000kPBkAAM_0EM440000002Rt5.png
  1. Select the Advanced tab and enter the connection string in Additional connection string parameters:


 

  1. The parameters of the connection string are as follows:


 

  1. DRIVER = The Driver name as given in the Simba JDBC Driver Config Guide.
  2. URL = Consists of three parameters(Project,Instance and Database) Update these three parameters as per the project.
  3. driverFile = Name of the driver jar file
  4. MSTR_JDBC_JAR_FOLDER = Local folder where the jar is stored.
ka044000000kPBkAAM_0EM440000002RtF.png
  1. Click OK which will redirect to the General tab.
  2. Select the newly created database connection from the list and click OK.
  3. Select your Project from the Folder List on the left.
  4. On the top, click on Schema > Warehouse Catalog
  5. Select current database instance: Select "spanner" from the drop down menu.
ka044000000kPBkAAM_0EM440000002RtU.png


 

  1. You should be able to see the Database Catalog .
  2. Right click on any table and select Table Structure to view the Table Schema.
ka044000000kPBkAAM_0EM440000002Rte.png


 

  • Right click on any table and select Show sample data to view sample content.
ka044000000kPBkAAM_0EM440000002Rtj.png

   


Comment

0 comments

Details

Knowledge Article

Published:

May 18, 2017

Last Updated:

May 18, 2017