This TOTD (Tip Of The Day) shows how to create a Persistence Unit
(PU) for a MySQL
database using NetBeans IDE. This PU can then be used in any of
Java EE artifacts (JSP, Servlet, EJB, ...) for database
interaction.
- In NetBeans IDE, create a new project
- Create a new NetBeans Web project and enter the values
("Autocomplete") as shown:
and click on "Next". - Choose GlassFish v2 as the deployment server and then click on "Finish".
- Create a new NetBeans Web project and enter the values
("Autocomplete") as shown:
- Set up the database
- Start the database as:
~ >sudo mysqld_safe --user root
Password:<YOUR …
- Start the database as: