Skip to content

Latest commit

 

History

History
 
 

cloud-client

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Getting Started with Cloud Spanner and the Google Cloud Client libraries

Cloud Spanner is a horizontally-scalable database-as-a-service with transactions and SQL support. These sample Java applications demonstrate how to access the Spanner API using the Google Cloud Client Library for Java.

Quickstart

Install Maven.

Build your project with:

mvn clean package -DskipTests

You can then run a given ClassName via:

mvn exec:java -Dexec.mainClass=com.example.spanner.ClassName \
    -DpropertyName=propertyValue \
    -Dexec.args="any arguments to the app"

Running a simple query (using the quickstart sample)

mvn exec:java -Dexec.mainClass=com.example.spanner.QuickstartSample -Dexec.args="my-instance my-database"

Tutorial

Running the tutorial

mvn exec:java -Dexec.mainClass=com.example.spanner.SpannerSample -Dexec.args="<command> my-instance my-database"

Test

mvn verify -Dspanner.test.instance=<instance id> -Dspanner.sample.database=<new database id>  -Dspanner.quickstart.database=<existing database id>