Friday 24 May 2013

Running First Hibernate 3.0 Example


Hibernate is free open source software it can be download fromhttp://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 hereand 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. 
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.

No comments:

Post a Comment

Simple CRUD in Laravel Framework

Creating, reading, updating, and deleting resources is used in pretty much every application. Laravel helps make the process easy using reso...