Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings
NotificationsYou must be signed in to change notification settings

jeffgbutler/mybatis-cockroach-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This demo is fashioned off of the Cockroach DB demos here:https://www.cockroachlabs.com/docs/v19.2/build-a-java-app-with-cockroachdb.html

The demo shows how to useMyBatis to interact withCockroachDB. The demo is a Spring Boot applicationand uses theMyBatis Spring Integration to make things easy to configure.

How To Run the Demo

  1. Install cockroach:brew install cockroachdb/tap/cockroach

  2. Start a Cockroach cluster:cockroach start --insecure

    You could also run CockroachDB constantly in the background withbrew services start cockroachdb/tap/cockroach

  3. Connect to cockroach shell:cockroach sql --insecure

    If you are running CockroachDB from the command line, you will need to do this in a separate terminal session.

  4. Run SQL commands to create the user and database...

    CREATEUSERIF NOT EXISTS maxroach;CREATEDATABASEbank;GRANT ALLON DATABASE bank TO maxroach;\q
  5. The application is configured to connect to CockroachDB running locally at the default port (26257). If you have CockroachDB running elsewhere, modifythe values insrc/main/resources/application.yml appropriately.

  6. Run the application:./gradlew bootRun - you should see the Spring app start, then several messages about database updates. Note that this requiresCockroachDB to be running and available as configured insrc/main/resources/application.yml

  7. You can also run the integration tests with./gradlew test. This will start CockroachDB in a Docker container and run the tests against that instance.This requires you to have Docker installed, but you do not need to install CockroachDB manually.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp