You are on page 1of 7

Connecting Netbeans with MySQL Database using Wizard

(Master/Detail Sample form)


To Connect Netbeans with MySQL Database using Wizard (Master/Detail Sample form):

1. Right-click on your project and select New> Others… option


2. In the New File wizard, select “Swing GUI forms” from the categories and
“Master/Detail Sample Form” from the file types and click the Next button.

New file master/detail form

3. Give a name to your class and select the package of your choice and click on the
Next button
Class and package name for the master-detail form

4. On the “Master Table” window click on the Database Connection drop-down


option and select “New Database Connection…” option.
5. On the “New connection wizard” window select “MySQL (Connection/J Driver)”
from the drop-down menu and click on Next button.
6. On the next window fill out your database details like host, port, database name,
database username and database password (if in case your database does not
have a password leave the password field empty)
New connection details

7. You can test the connection by clicking on the “Test Connection” button and click
on the “Finish” button.
8. Select the columns that you want to display and click on the “Next>” button.
Select columns

9. On “Details Option” window click on “Finish” button.


Details options

10. After NetBeans finishes generating the necessary files, you can generate the
master data sample
Netbeans master table sample
Once you’ve tested out MySQL database connectivity, you can create your custom
projects by modifying the necessary methods and statements. You can share your
feedback and query related to our this article in the comments.

You might also like