Reputation: 75
Can anyone please help me to know what are the jar files must I add to build path to create a project using hibernate in eclipse?
This is my first project and I do not have any clear idea about adding jars,but I suppose to create a project in a week (and that must be run correctly)!
The topic that has given to me is "we will need to get the input from the user while its run time and the input must be inserted into a table in MySQL database" please help me as soon as possible!
Thanks in advance!!!!!
Upvotes: 1
Views: 1124
Reputation: 127
Download hibernate project from here
http://sourceforge.net/projects/hibernate/files/hibernate4/4.2.3.Final/
If you are using windows then download the zip. Unzip the file and search for lib/required folder. Add all the jars in your project.
Now for mysql go to following url and download the connector jar.
http://dev.mysql.com/downloads/connector/j/
Include the jar in your project.
Hope this helps to get you getting started
Alternatively use maven
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.2.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.12</version>
</dependency>
Regards Niraj
Upvotes: 0
Reputation: 7836
This is well explained in the Hibernate documentation.
antlr-2.7.7.jar
commons-collections-3.2.1.jar
dom4j-1.6.1.jar
javassist-3.12.1.GA.jar
hibernate-core-4.0.1.Final.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
jboss-logging-3.1.0.CR2.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
You can download hibernate from this link. The zip file which you download will have a required folder inside lib.It will be having all the necessary jars.
The lib/required/ directory contains all the JARs Hibernate requires. All the jars in this directory must also be included in your project's classpath.
Upvotes: 2
Reputation: 6111
Let me answer you,
what jars are needed for hibernate depends on what version of hibernate you want to use for inserting data in your DB.
if it just data insertion matters, then you can go for hibernate 2, 3 any version.
Here, your familiarity with annotation and xml will come in picture.
Link will help you : http://www.mkyong.com/tutorials/hibernate-tutorials/
Upvotes: 0