This chapter defines the Task Time Tracker (3T) database design and configures NetBeans as a client of MySQL server.
The 3T application will be used to keep track of the time spent on different tasks for different company projects. The main entities are:
These entity definitions result in a very simple database design:
We will prefix all of our 3T tables with ttt_
. Large enterprise databases may contain hundreds of tables, and you will soon appreciate the prefixing of table names to group related tables.
Click on the Services tab in the NetBeans IDE, and navigate to Databases | Drivers. You will see that NetBeans comes with several different database drivers:
Right-click on the Databases node, and click on Register MySQL Server…as shown in the following screenshot:
For Windows users, this will open a dialog box with default settings. Enter the admin password used when installing MySQL server in the previous chapter, and check the Remember Password option:
Mac users will see a different window prior to setting the connection properties. Select the MySQL driver before clicking on the Next button:
This will then allow you to specify the required database connection details:
When finished with these tasks, you will see MySQL Server listed in the Databases node. Right-click on the server, and select Connect to connect to the server (if not already connected):
This will connect NetBeans to MySQL server and list the available databases. Right-click on the server, and select Create Database as shown in the following screenshot:
Enter the database name as shown in the following screenshot, and click on OK to create the database:
The final step is to connect to the newly created task_time_tracker database. Right-click on task_time_tracker and select Connect… as shown in the following screenshot:
This will add a MySQL database connection entry for the task_time_tracker database, which can be opened by right-clicking on it whenever required:
Now you can right-click on the database connection and select the Execute Command… option to open the SQL Command editor in the workspace:
The SQL Command editor is where you will type and execute commands against the database:
3.147.47.166