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/spanner/r2dbc at main · llatif/java-docs-samples

Expand file tree

/

r2dbc

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

r2dbc

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
src
src
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

README.md

Outline

Cloud Spanner R2DBC Example

This sample application demonstrates using Spring Data R2DBC with Google Cloud Spanner.

Maven

This sample uses the Apache Maven build system. Before getting started, be sure to download and install it. When you use Maven as described here, it will automatically download the needed client libraries.

Setup

  1. Follow the set-up instructions in the documentation.

  2. Enable APIs for your project. Click here to visit Cloud Platform Console and enable the Google Cloud Spanner API.

  3. Create a Cloud Spanner instance and database via the Cloud Plaform Console's Cloud Spanner section.

  4. Enable application default credentials by running the command gcloud auth application-default login.

Run the Example

  1. Set up the following environment variables to help the application locate your database:

    export project=[PROJECT]
    export instance=[INSTANCE]
    export database=[DATABASE]
    
  2. Then run the application from command line, after switching to this directory:

    mvn spring-boot:run
    
  3. Go to http://localhost:8080/index.html and experiment with it. You'll be able to create and drop a simple table called NAMES, containing two columns: a unique identifier (UUID) and a single data column called NAME.

All functionality is done through the Spring Data objects that were automatically configured by Spring Boot.

You are visitor 01402775 — 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.