Enterprise ApplicationDevelopment with Ext JSand Spring
上QQ阅读APP看书,第一时间看更新

Connecting NetBeans with MySQL

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:

Connecting NetBeans with MySQL

Right-click on the Databases node, and click on Register MySQL Server…as shown in the following screenshot:

Connecting NetBeans with MySQL

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:

Connecting NetBeans with MySQL

Mac users will see a different window prior to setting the connection properties. Select the MySQL driver before clicking on the Next button:

Connecting NetBeans with MySQL

This will then allow you to specify the required database connection details:

Connecting NetBeans with MySQL

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):

Connecting NetBeans with MySQL

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:

Connecting NetBeans with MySQL

Enter the database name as shown in the following screenshot, and click on OK to create the database:

Connecting NetBeans with MySQL

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:

Connecting NetBeans with MySQL

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:

Connecting NetBeans with MySQL

Now you can right-click on the database connection and select the Execute Command… option to open the SQL Command editor in the workspace:

Connecting NetBeans with MySQL

The SQL Command editor is where you will type and execute commands against the database:

Connecting NetBeans with MySQL