Skip to content

A "console-website" written in java via JDBC in a MVC architecture. Which uses and manipulates data(tables) created in postgreSQL via pgADMIN.

Notifications You must be signed in to change notification settings

Hawkrin/KTH-IV1351-MusicSchoolWebsite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A console "website" which gets and manipulates data from a database created in postgreSQL

Learning Outcome:

  • Analysis in the form of a Conceptual model and a Physical/Logical model.
  • Create a database and insert template data(postgreSQL)
  • Creating queries which can be used by sql and a java program via JDBC.

Physical/Logical model: analysFix1

Conceptual Model: analysFIX3

A JDBC application with an appropriately layered architecture

This is an example of how an integration layer can be used to organize an application containing database calls.

How to execute

  1. Clone this git repository
  2. Change to the newly created directory cd jdbc-bank
  3. Make sure there is a database which can be reached with the url on line 235-236 or 237-238 in BankDAO.java. There are two ways to do this.
    1. Create a database that can be reached with one of the existing urls. If postgres is used, that is a database called bankdb, wich can be reached on port 5432 at localhost, by the user 'postgres' with the password 'postgres'. If MySQL is used, that is a database called bankdb, which can be reached on port 3306 at localhost, by the user 'root' with the password 'javajava'.
    2. Change the url to match your database.
  4. Create the tables described by src/main/resources/mysql-bankdb.sql (if yo use mysql) or src/main/resources/postgres-bankdb.sql (if you use postgres).
  5. Build the project with the command mvn install
  6. Run the program with the command mvn exec:java

Commands for the bank program

  • help displays all commands.
  • new <holder name> creates a new account owned by the specified holder.
  • list lists all existing accounts.
  • list <holder name> lists all accounts owned by the specified holder.
  • balance <account number> shows the balance of the account with the specified number.
  • deposit <account number> <amount> deposits the specified amount to the account with the specified number.
  • withdraw <account number> <amount> withdraws the specified amount from the account with the specified number.
  • delete <account number> deletes the account with the specified number.
  • quit quits the application.

About

A "console-website" written in java via JDBC in a MVC architecture. Which uses and manipulates data(tables) created in postgreSQL via pgADMIN.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages