Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Outline

Getting Started with Cloud Spanner and the Google Cloud Client libraries

Open in Cloud Shell

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 from the root directory (java-spanner):

mvn clean package -DskipTests
cd samples/snippets
mvn package

Every subsequent command here should be run from a subdirectory samples/snippets.

Running samples

Usage:

java -jar target/spanner-snippets/spanner-google-cloud-samples.jar operation my-instance my-database

Examples

Create Database:

java -jar target/spanner-google-cloud-samples-jar-with-dependencies.jar my-instance my-database

Listing database operations:

java -jar target/spanner-snippets/spanner-google-cloud-samples.jar listdatabaseoperations my-instance my-database
Morty Proxy This is a proxified and sanitized view of the page, visit original site.