JDBC project for TDT4145 Data Modelling, Databases and Database Management Systems
By Ask Sommervoll, Claus Martinsen, Henrik Fauskanger and Nora Bodin
For this small project we implemented a Active Domain Object pattern for database access, providing a simple programmatic interface for retrieving and operating on the data.
WARNINIG: Because of the nature of this project, norwegian and english is used interchangebly in the source code (the GUI is in norwegian). It's bad practice but oh well...
-
Run the updated SQL script for creating the required database structure on your preffered MySQL server.
-
Run
release_1.0.jar
or the main method in the source code to launch the application. -
Click the
Instillinger
button to access database settings. Change the URL, username and password to match your setup.
Our Active Domain Object classes represent the entities we care about in the database and provides the necessary methods for interacting with them.
The most important methods of all ADOs is:
.save()
, which saves the objects state to the database..getAll()
(static), which fetches all objects of a certain type (rows from a certain table) from the database..getById(int id)
(static), which fetches a object with a certain ID from the database.
For in-depth information about how the classes work, see the respective JavaDoc
.
We use JavaFX for our GUI and have one Controller for each screen in the application. The controllers use our Active Domain Objects to interact with the database, decoupling UI from database logic.
Page is an Enum for all FXML pages.
TrainingApp is the Application which launches the JavaFX GUI.