Skip to content

YANGZ001/distributedDatabase

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Java Application for YugabyteDB

The application connects to your YugabyteDB instance via topology-aware JDBC driver and performs basic SQL operations. The instructions below are provided for YugabyteDB Managed deployments. If you use a different type of deployment, then update the /src/main/resources/app.properties file with proper connection parameters.

Prerequisite

  • Java Development Kit, version 8 or later
  • Maven 3.0 or later
  • Command line tool or your favourite IDE, such as IntelliJ IDEA, or Eclipse.

Start YugabyteDB Managed Cluster

Build and Run App

  1. Build the app with Maven:
    mvn clean package
  2. Run the app:
    java -cp target/yugabyte-simple-java-app-1.0-SNAPSHOT.jar SampleApp

Upon successful execution, you will see output similar to the following:

>>>> Successfully connected to YugabyteDB!
>>>> Successfully created DemoAccount table.
>>>> Selecting accounts:
name = Jessica, age = 28, country = USA, balance = 10000
name = John, age = 28, country = Canada, balance = 9000

>>>> Transferred 800 between accounts.
>>>> Selecting accounts:
name = Jessica, age = 28, country = USA, balance = 9200
name = John, age = 28, country = Canada, balance = 9800

About

CS5424 Course: Distributed Database project @nus.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%