A Java-based Library Management System with a GUI (Swing), supporting In-Memory and MySQL Database storage options.
- Add, Search, and Remove Books
- Search by Title and Author
- Choose between In-Memory and MySQL Storage
- Swing GUI Interface
- Java 23
- Swing (for GUI)
- JDBC (for database conenction)
- MySQL (for database storage)
Clone the repository to your local machine:
git clone https://github.com/Kaloyanov5/Library-App.git
cd Library-System
To use the DatabaseBookRepository, you need the JDBC driver for MySQL:
- Download the MySQL Connector/J (JDBC driver) from the official MySQL website.
- After downloading, add the JDBC JAR file to your project classpath.
If you're using IntelliJ IDEA, follow these steps to add the driver:
- Open Project Structure (File > Project Structure).
- Navigate to Libraries and click the
+
sign. - Select the downloaded JDBC JAR file to add it as a library.
- Open the project in IntelliJ IDEA.
- Select Main.java as the main class.
- Click Run
▶️ .
javac -d out src/Main.java
java -cp out Main
If you're using DatabaseBookRepository, follow these steps to configure the database:
- MySQL Connection: Ensure your database connection settings are correct in the
db_config.properties
file located in theresources/
folder. - Table Creation: Run the
schema.sql
script (found insrc/database
) in MySQL Workbench to create the necessary tables in your MySQL database.
- Run the program.
- Select either In-Memory Storage or Database Storage.
- Use the GUI to add, search, or remove books.
- View the results in the output area of the GUI.
This project is open-source and available under the MIT License.
Feel free to submit pull requests! For major changes, please open an issue first to discuss your ideas