Skip to content

A project I built while learning Java Database Connectivity. Implements CRUD, Data Access Object pattern on a postgreSQL database built ontop a docker container.

Notifications You must be signed in to change notification settings

Kikiodazie/learning-jdbc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning JDBC

A project I built while learning Java Database Connectivity. Implements CRUD, Data Access Object pattern on a postgreSQL database built ontop a docker container.

Getting Started

Clone this repo to your local machine How To Guide

Order of operations

These commands are for linux/Mac, changes will need to made if you are running this in Microsoft Windows.

Prerequisites

Running PostgreSQL

  1. Pull Docker Image docker pull postgres

  2. Build data directory mkdir -p ~/srv/postgres

  3. Run docker image docker run --rm --name lil-postgres -e POSTGRES_PASSWORD=password -d -v $HOME/srv/postgres:/var/lib/postgresql/data -p 5432:5432 postgres

Stopping PostgreSQL

docker stop lil-postgres

Logging into Database

  • psql -h localhost -U postgres -d hplussport

Creating starter data

  1. psql -h localhost -U postgres -f database.sql
  2. psql -h localhost -U postgres -d hplussport -f customer.sql
  3. psql -h localhost -U postgres -d hplussport -f product.sql
  4. psql -h localhost -U postgres -d hplussport -f salesperson.sql
  5. psql -h localhost -U postgres -d hplussport -f orders.sql

Running the tests

After setting up development environment, docker container

  • Build & Run
  • Can also run SQL commands on terminal after logging in.

You should comprehensive outputs in the terminal....Hurray you have a functional database.

Built With

Authors

  • Divine Odazie

About

A project I built while learning Java Database Connectivity. Implements CRUD, Data Access Object pattern on a postgreSQL database built ontop a docker container.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published