A Java Swing desktop application for managing student records with SQLite database integration.
MCTI_SRDB is a comprehensive student record management system built with Java Swing and SQLite. It provides a user-friendly GUI for performing CRUD (Create, Read, Update, Delete) operations on student data including ID numbers, names, age, and addresses.
- Add Records: Insert new student records with validation
- Edit Records: Modify existing student information
- Delete Records: Remove student records from the database
- Search Functionality: Find students by ID number
- Real-time Clock: Display current date and time
- Data Persistence: SQLite database for reliable data storage
- Background Image: Custom UI with background image support
- Language: Java
- GUI Framework: Java Swing with NetBeans Form Designer
- Database: SQLite with JDBC driver
- Build Tool: Maven
- Layout Manager: AbsoluteLayout (NetBeans)
AddRec/
├── src/main/java/
│ └── addrec/
│ ├── AddRec.java # Main GUI class
│ ├── AddRec.form # NetBeans form file
│ └── DatabaseHelper.java # Database operations
├── pom.xml # Maven configuration
└── records.db # SQLite database (auto-generated)
The application uses a SQLite database with the following table structure:
CREATE TABLE IF NOT EXISTS records (
id TEXT PRIMARY KEY,
firstName TEXT NOT NULL,
lastName TEXT NOT NULL,
age INTEGER NOT NULL,
address TEXT NOT NULL
);
- SQLite JDBC Driver:
org.xerial:sqlite-jdbc:3.45.3.0
- NetBeans AbsoluteLayout: For GUI layout management
- Java 24 or higher
- Maven 3.6+
- NetBeans IDE (recommended for form editing)
-
Clone the repository:
git clone <repository-url> cd AddRec
-
Build the project:
mvn clean compile
-
Run the application:
mvn exec:java -Dexec.mainClass="addrec.AddRec"
java -cp target/classes:lib/* addrec.AddRec
- Fill in all required fields (ID Number, First Name, Last Name, Age, Address)
- Click the "Add" button
- The record will be saved to the database and displayed in the table
- Select a row from the table
- Click the "Edit" button to load data into form fields
- Modify the desired fields
- Click "Edit" again to confirm changes
- Enter an ID number in the "Search ID" field
- Click the "Search" button
- The matching record will be highlighted in the table
- Option to load the record for editing
- Select a row from the table
- Click the "Delete" button
- The record will be permanently removed
- Main application class extending JFrame
- Handles all GUI events and user interactions
- Manages form validation and data display
- Implements real-time clock functionality
- Static utility class for database operations
- Provides methods for CRUD operations
- Handles SQLite connection management
- Includes database initialization
- Checks for empty fields before adding records
- Validates age field as numeric input
- Prevents duplicate ID entries
- Confirmation dialogs for critical operations
- Clear field functionality after operations
- Table selection and highlighting
- Real-time date/time display
- Automatic database and table creation
- Prepared statements for SQL injection prevention
- Connection pooling and proper resource cleanup
- Error handling and logging
The application supports custom background images. Place your image in:
src/main/resources/images/Marvelous.jpg
- Form layout can be modified using NetBeans Form Designer
- Colors and fonts are configurable in the .form file
- Button positions use AbsoluteLayout constraints
Database Connection Error:
- Ensure SQLite JDBC driver is in classpath
- Check file permissions for database creation
GUI Layout Issues:
- Verify AbsoluteLayout dependency is available
- Check form file integrity
Build Failures:
- Confirm Java 24 compatibility
- Update Maven dependencies if needed
The application includes comprehensive error handling for:
- Database connection failures
- Invalid input data
- File system permissions
- SQL execution errors
- Separation of concerns between GUI and database logic
- Event-driven programming model
- Static utility pattern for database operations
- Form-based GUI design with NetBeans integration
- Prepared statements for SQL operations
- Resource management with try-with-resources
- Input validation and sanitization
- User feedback through dialog messages
When contributing to this project:
- Maintain the existing code structure
- Follow Java naming conventions
- Add appropriate error handling
- Update documentation as needed
- Test all CRUD operations thoroughly
This project is developed for educational purposes as part of MCTI coursework.
Miles Garcia - MCTI Student Records Database System
Note: This application uses NetBeans Form Designer. Opening .form files requires NetBeans IDE for visual editing.