GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-docs-samples/appengine-java11/spanner at master · classicvalues/java-docs-samples

Expand file tree

/

spanner

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

spanner

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src/main
src/main
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Google Cloud Spanner Sample

Open in Cloud Shell

This sample demonstrates how to use Google Cloud Spanner from Google App Engine standard Java 11 environment.

Setup your Google Cloud Platform Project

  • Install the Google Cloud SDK and run:
   gcloud init

If this is your first time creating an App engine application:

   gcloud app create

Setup the Sample App

  • Copy the sample apps to your local machine:
  git clone https://github.com/GoogleCloudPlatform/java-docs-samples
  • Add the appengine-simple-jetty-main Main class to your classpath:
  cd java-docs-samples/appengine-java11/appengine-simple-jetty-main
  mvn install
  • Create a Spanner instance.

  • Update SPANNER_INSTANCE value in [app.yaml](src/main/appengine/app.yaml) with your instance id.

  • Move into the appengine-java11/spanner directory and compile the app:

  cd ../spanner
  mvn package

Endpoints

  • /spanner : will run sample operations against the spanner instance in order. Individual tasks can be run using the task query parameter. See SpannerTasks for supported set of tasks. Note : by default all the spanner example operations run in order, this operation may take a while to return.

Deploying

mvn clean package appengine:deploy

To see the results of the deployed sample application, open https://PROJECT_ID.appspot.com/spanner in a web browser. Note : by default all the spanner example operations run in order, this operation may take a while to show results.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.