Following an internet tutorial I have done the following:

  1. I have created the database called test and the table called persona with SQL.

  2. I have created a java Maven project, called HibernateExample1 with Netbeans 16 and JDK 19.

    Captura de pantalla 2022-12-13 a las 12.00.35.png

  3. I have modified the pom.xml file to add dependencies. I have only added the ones highlighted in blue, the rest have been added by themselves by doing clean & build in the project.

    Captura de pantalla 2022-12-13 a las 12.05.00.png

  4. I have created the persistence.xml file

    Captura de pantalla 2022-12-13 a las 12.07.10.png

    Captura de pantalla 2022-12-13 a las 12.08.36.png

  5. I have created the file log4j2.xml

    Captura de pantalla 2022-12-13 a las 12.10.24.png

  6. I have created the class Persona.java which has the same attributes as my SQL table.

    Captura de pantalla 2022-12-13 a las 12.13.36.png

  7. And finally, I have created the class HolaMundoHibernate.java to run the program.

    Captura de pantalla 2022-12-13 a las 12.15.13.png

When I run the program I get the following error.

Captura de pantalla 2022-12-13 a las 12.16.34.png

The structure of my project is as follows.

Captura de pantalla 2022-12-13 a las 12.18.58.png