Please refer to the requirement and report (both in Chinese) for more information.
TeacherDB is a database application designed to manage and record teaching and research activities of teachers. This system allows administrators to handle teacher information, manage publications, projects, and courses, and generate reports.
- Teacher Management: Add, delete, modify, and query teacher information including ID, name, gender, and title.
- Publication Management: Manage paper information with add, delete, modify, and query functionalities. Ensure unique corresponding authors and non-repeated author rankings.
- Project Management: Handle project details with add, delete, modify, and query functionalities. Ensure non-repeated rankings and total allocated funds match project funds.
- Course Management: Manage course information with add, delete, modify, and query functionalities. Ensure total teaching hours match course hours for each semester.
- Research and Teaching Summary: Query and summarize a teacher's activities over a specified year range, with an option to export the data.
The system is built using JavaFX for the GUI and MySQL for the database. The application is structured into several modules:
- Main Application: Entry point with navigation to different management functionalities.
- Data Objects: Represent entities like Teacher, Paper, Project, Course, etc., and handle database operations.
- Database Handler: Implements JDBC for database interactions.
- Main Interface: Provides buttons for navigating to different management sections.
- Management Interfaces: Allow CRUD operations on teachers, papers, projects, and courses.
- Validation: Ensures data integrity through triggers and stored procedures.
- Export Functionality: Enables data export to text files.
The database consists of seven tables: Teachers, Papers, Projects, Courses, PublishedPapers, ParticipatedProjects, and SelectedCourses. Triggers and procedures ensure data consistency and integrity.
- JDK: OpenJDK 22.0.1
- JavaFX: 22.0.1
- JDBC: MySQL Connector/J 8.4.0
To compile and run the program, specify the JavaFX and JDBC paths:
javac --module-path /path/to/javafx-sdk/lib --add-modules javafx.controls Main.java
java --module-path /path/to/javafx-sdk/lib --add-modules javafx.controls -cp ".;/path/to/mysql-connector-j-8.4.0.jar" Main
The system has been thoroughly tested for functionality, including project management and teacher workload queries. Error handling is implemented to ensure stability.
- Project Fund Validation: Implemented a "Check" button to verify total fund allocation.
- JDBC Stored Procedures: Adjusted data types to ensure compatibility with Java variables.
TeacherDB effectively manages teacher-related data and provides robust querying capabilities. It highlights the use of JavaFX for GUI design and JDBC for database operations, ensuring data consistency and application stability.