Setup Hibernate Environment
- To work with hibernate framework we need to add .jar(s) files provided by that framework to our java application.
- No framework is installable software, it means we doesn’t contain any setup.exe
- When we download any framework, we will get a ‘zip’ file and we need to unzip it, to get the required jar files, actually all frameworks will follow same common principles like
- Framework will be in the form of a set of jar files, where one jar file acts as main (We can call this file as core) and remaining will acts as dependent jar files.
- Each Framework contain at least one configuration xml file, but multiple configuration files also allowed.
- We can download hibernate jar files from the following links. Based on requirement we can download the corresponding version.
For version 2.x (http://sourceforge.net/projects/hibernate/files/hibernate2/) For version 3.x (http://sourceforge.net/proiects/hibernate/f1les/hibernate3/) For version 4.x (http://sourceforge.net/projects/hibernate/f1Ies/hibernate4/)
- While downloading select .zip file for windows environment, select .tar flle for unix environment.
- After downloading the zip file, unzip it and we can find the required jars in the extracted folder. If we consider 4.x version, we need the following jars to work with hibernate application.
antlr-2.7.7.jar dom4j-1.6.1.jar hibernate-commons-annotations-4.0.2.Final.jar hibernate-core-4.2.4.Final.jar hibernate-jpa-2.0-api-1.0.1.Final.jar hibernate-jpa-2.0-api-1.0.1.Final.jar javassist-3.15.0-GA.jar jboss-logging-3.1.0.GA.jar jboss-transaction-api_1.1_spec-1.0.1.Final.jar
Along with the hibernate jars we must include one more jar file, which is nothing but related to our database, this is depending on your database. For example, if we are working with Oracle we need to add ojdbc6.jar.