Hibernate is free open source software it can be download from http://www.hibernate.org/6.html. Visit the site and download Hibernate 3.0. You can download the Hibernate and install it yourself. But I have provided very thing in one zip file. Download the example code and library from here and extract the content in your favorite directory say "C:\hibernateexample". Download file contains the Eclipse project. To run the example you should have the Eclipse IDE on your machine. Start the Eclipse project and select Java Project as shown below.
Click on "Next" button. In the next screen leave the output folder as default "hibernateexample/bin".
Click on the "Finish" button.
Now Open the FirstExample.java in the editor as show below.
Copy contact.hbm.xml, and hibernate.cfg.xml in the bin directory of the project using windows explorer. To run the example select Run-> Run As -> Java Application from the menu bar as shown below.
This will run the Hibernate example program in Eclipse following output will displayed on the Eclipse Console.
In this section I showed you how to run the our first Hibernate 3.0 example.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: December 7, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles