I am currently trying to go through this tutorial netbeans + hibernate + JavaSE ( http://netbeans.org/kb/docs/java/hibernate-java-se.html ). Everything is pretty good, but after creating hibernate.cfg.xml, when it comes to the part where reverse engineering is required, it comes to some strange message that the reverse engineering wizard tells me:
"The database drivers are not added to the project classpath." "Go to project properties to add database library.".
Well, this is strange because hibernate.cfg.xml was created by netbeans. I checked the database connection with the connection data from the hibernate.cfg.xml file and everything seems to be in order, so the manual connection works very well. Does anyone know what is going on here? Am I doing something wrong?
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/sakila</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">apassword</property> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> </session-factory> </hibernate-configuration>
source share