Hibernate 3.0 Jars
In this tutorial I will explain you 1. What are the required jars for Hibernate 3.0? 2. How to set up hibernate 3.0 environment in IDE (Eclipse/Netbeans)?After doing complete set up we can do hibernate examples easily.
When I started learning Hibernate it took me many hours to do complete Hibernate set up.
I did not find a complete resource for Hibernate 3.0 Set Up on a single website.
Reason was 1) I did not find complete jars at one place. Some were mentioning them but not providing resources from where I can download Hibernate jars. 2) Some provided Jars but missed the other ones like configuration files, mapping files.
I remember I started at 10 AM (Morning) in the morning and I ended up with my first Hibernate Example around 1 PM (Night).
Some basic knowledge will also play an important role. Moreover reading comment thread in tutorials helped me a lot.
So let us see step by step configuration of Hibernate 3.0.
List of Must have Hibernate 3.0 Jars
Below mentioned 9 jars are required to work with Hibernate 3.01. asm.jar
2. cglib-2.1.3.jar
3. commons-collections-2.1.1.jar
4. commons-logging-1.0.4.jar
5. dom4j-1.6.1.jar
6. ehcache-1.1.jar
7. hibernate3.jar
8. jta.jar
9. log4j-1.2.11.jar
Please download the above mentioned jars can be downloaded from sourceforge website. I would suggest to download the .zip file from sourceforge website.
Apart from the above mentioned 9 jars, we need some Database dependent jars.
Hibernate Database Dependent Jars
Apart from the above mentioned 9 jars, we need some Database dependent jars.Developers use different databases. I use MySql. You may use Oracle, derby or any other database.
So while doing Hibernate 3.0 Set up we need to include these database dependent jars along with above 9 jars in user library.
Below you can get the specific jars for Mysql and Derby database.
The following are required for the MySql Database :
1. mysql-connector-java-5.1.25-bin.jarThe following are required for the Derby setup :
1. Derby.jar2. Derbyclient.jar
3. Derbynet.jar
Basic requirements
Apart from this we need some basic requirements1. We must need JDK 1.6 or the latest version of JDK installed on our system. Please always use the latest JDK.
2. IDE – We can use the latest Eclipse, Netbeans – By using IDE tool you can do examples more quickly. In this tutorial I will explain step by step guide to set up Hibernate required jars in Eclipse. The same way we can follow in NetBeans also.
3. Database – We can use Database like MySql, Oracle or Apache Derby)
Setting Up Hibernate jars in Eclipse
So in the last we will have hibernate 3.0 required jars (List of Must have Hibernate 3.0 Jars + Database Dependent Jars) ready with us.Now we will set up hibernate environment in Eclipse. It is nothing but adding the required jars in Eclipse library.
1. Please list out your jars and keep them in a folder like D:/lib/hibernate3.0
2. Open Eclipse and create one java project with name “Hibernate3SetUp”.
3. In Eclipse, go to Windows > Preferences > Java > Build Path > User Libraries
4. Click on New Button on the top right side of the Eclipse.
5. Now it will ask you to provide “User library name”. You can give it “hibernate3″. Say Ok.
6. After that please select “hibernate3″ in user libraries and then click on “Add External Jars”.
You can add all the hibernate jars with you in this step.
How to add user library to a Java Project
We have done with Hibernate 3.0 set up. We have added the required jars in Eclipse library.Whenever we will create a new project we have to add this “hibernate3″ (user library) to our java project.
We can add this “hibernate3″ user library when we are creating a java project newly. We can also add this user library “hibernate3″ to existing java projects.
For adding this user library to your standalone java project please follow the following steps.
1. Create one java project. Give any name for java project. I am giving “HibernateHelloWorld”.
2. Click on next.
3. Go to Libraries tab and add the library “hibernate3″.
4. Then click on Finish.
In this way you can add user libraries to your java project.
In case you required any specific information. Please let me know by giving your comments.
0 comments
Post a Comment