Skip to content

kayra-polat/Library-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📚 Library-Management-System

  • A library management system made using Postgresql. This project was designed during the course "Relational Databases CMPE232" with Baturalp Kızıltan

Entity Relationship Diagram and Relational Schema

Java Application Program

  • In the Java command line interface part, we implemented an API to provide some functionalities of our database to end user. At the very first part, the program must make a connection through the database with authorization credentials. So, we created a “config.txt” file under the “/project_root_directory/res/” folder to store user secrets properly. The file includes both local and remote configurations as key-value pairs for ease of use (you can edit local values to test it out on your machine). After we passed the credentials into the Java program, the program asks for connection type (local/remote). Then it connects to the database with the help of Postgres JDBC driver (included inside the “/project_root_directory/lib/” folder).

    image

  • Later on, the program displays 5 options to retrieve data, to commit a query or to quit program. First option is an insertion statement. The program wants necessary attributes to create a tuple (book) in the database. It gives an error if you leave a “NOT NULL field” empty. Otherwise, you can directly tap to “enter” to skip for nullable attributes. Second option is an update statement. The program wants an existing publisher’s ID and updates its city according to the user input as an example case. And third option is a deletion statement. The program waits for user id and room id. Then it deletes the reservations related to both the user and the room. Finally, the fourth option provides a listing operation. It is possible to view almost all tables in the database with this command (including the tables which was used in first 3 options). The program prints the output of a chosen table to console. All of the features above are controlled by “while-loop” and “switch-case” control statements depending on the user input.

    image

    (Main Menu)

    image

    (Result Table)

  • Additionally, the program’s source file contains helper functionalities which was defined by us in the Helper class. For example, “PRESS_ENTER_TO_CONTINUE” method waits until be sure about that user’s get acknowledged or “printResultSet” method shows retrieved table (result set) in a prettier state. These methods were provided to enhance user experience and to make code more modular. Also, the functions such as “getInputStr” and “getInputInt” offers required exception handling system and saves us from writing duplicate lines of code to pass the user input into statements.

About

Intermediate Library Management System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages