For setting up Hibernate, we need to include the Hibernate JAR file.
Along with this, we also need to add the JDBC driver JAR file. We will be using MySQL database for the hibernate programs. To connect to MySQL database, we will need mysql-connector-java.jar file.
We can perform the setup in following ways :
Option 1 : Download JARs directly
We can directly download the hibernate-core JAR file from Hibernate website :
The MySQL driver JAR can be downloaded from :
Both the JARS can then be added to classpath for a standalone JAVA program or added to the lib folder for a J2EE project.
Option 2 : Using Maven
If using Maven in the project, we can just use the dependencies for the hibernate-core and driver in the pom.xml :
You can update the version of the hibernate-core and mysql-connector-java depending on the version of JAR file you plan to use.
© 2016, www.topjavatutorial.com. All rights reserved. On republishing this post, you must provide link to original post