Skip to content

tanvx-training/java-utc

Repository files navigation

Library Management System

A desktop library management system built with Java Swing that automates core library operations including document management, reader management, borrowing/returning processes, search functionality, and reporting capabilities.

Project Structure

library-management-system/
├── src/
│   ├── main/
│   │   ├── java/
│   │   │   └── com/library/
│   │   │       ├── dao/           # Data Access Objects
│   │   │       ├── service/       # Business Logic Layer
│   │   │       ├── model/         # Entity Classes
│   │   │       ├── gui/           # Swing GUI Components
│   │   │       ├── util/          # Utility Classes
│   │   │       ├── exception/     # Custom Exceptions
│   │   │       └── LibraryManagementApplication.java
│   │   └── resources/
│   │       ├── application.properties
│   │       ├── database.properties
│   │       └── logback.xml
│   └── test/
│       ├── java/
│       └── resources/
├── logs/                          # Application logs
├── pom.xml                        # Maven configuration
└── README.md

Technologies Used

  • Java 11 - Programming language
  • Maven - Build and dependency management
  • Swing - GUI framework
  • Oracle Database - Database (JDBC connectivity)
  • SLF4J + Logback - Logging framework
  • JUnit 5 - Unit testing
  • Mockito - Mocking framework for tests

Prerequisites

  • Java 11 or higher
  • Maven 3.6 or higher
  • Oracle Database XE 21c or higher (for database connectivity)

Building the Project

  1. Clone the repository
  2. Navigate to the project directory
  3. Run Maven commands:
# Compile the project
mvn clean compile

# Run tests
mvn test

# Package the application
mvn clean package

# Run the application
mvn exec:java -Dexec.mainClass="com.library.LibraryManagementApplication"

Configuration

Database Configuration

Edit src/main/resources/database.properties:

db.url=jdbc:oracle:thin:@localhost:1521:XE
db.username=your_username
db.password=your_password
db.driver=oracle.jdbc.OracleDriver

Database Setup

  1. Install Oracle Database XE 21c (or higher)
  2. Create Database User:
    -- Connect as SYSTEM or SYS
    CREATE USER library_user IDENTIFIED BY library_password;
    GRANT CONNECT, RESOURCE, CREATE VIEW TO library_user;
    GRANT UNLIMITED TABLESPACE TO library_user;
  3. Initialize Database: The application will automatically create tables and insert sample data on first run if db.auto.create.tables=true is set in the configuration.

Application Configuration

Edit src/main/resources/application.properties to customize:

  • Application settings
  • Business rules (borrowing limits, fine amounts)
  • UI preferences

Logging

The application uses SLF4J with Logback for logging. Log files are created in the logs/ directory:

  • library-management.log - General application logs
  • database.log - Database operation logs
  • errors.log - Error-level logs only

Development Status

This project is currently in the initial setup phase. The following components have been implemented:

Task 1: Project Structure and Core Configuration

  • Maven project structure
  • Database connection configuration
  • Logging configuration (SLF4J + Logback)
  • Main application entry point
  • Basic window framework
  • Configuration management system

Next Steps

The following tasks are planned for implementation:

  • Core data models and entities
  • Database schema and connection management
  • Data Access Layer (DAO pattern)
  • Business Logic Layer (Service classes)
  • Presentation Layer (Swing GUI)
  • Error handling and validation
  • Comprehensive test suite
  • Configuration and deployment

License

This project is developed for educational purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages