|
Page 1 of 5 As per http://www.hibernate.org, Hibernate is a powerful, ultra-high performance object/relational persistence and query service for Java. Hibernate gives you the option to code and work with Java and use Hibernate's capabilities to interact with the database. No need to write SQL in your Java code. You work with Java objects and Hibernate does the rest. In this "Quick Hibernate" series of articles, Satish Talim gets you started with Hibernate. Satish's hands-on approach should have you developing with Hibernate in no time.
Also check out Satish's interview: Java and J2EE Today
Quick
Hibernate
By Satish Talim
We need a means of taking information from a
SQL database and turn it into Java objects, and vice-versa. The general problem is known as Object/Relational Mapping. Hibernate is a
lightweight O/R mapping service for Java and gives you the
means for
persisting your Java objects to and from an underlying database. Rather
than you writing the SQL and converting queries to and from first class
objects, Hibernate can take care of all this for you. You only concern
yourself with the objects, Hibernate worries about the SQL and making
sure things end up in the right tables.
There
are many books and articles available on Hibernate and what I want to
do here is quickly get you started with Hibernate. I want to take this
opportunity to thank Glen Smith for showing me the
quick way to get started with Hibernate and this blog is based on that
and dedicated to him.
Quick Installation and
Setup
- Install J2SDK 1.4.2
- Install Ant
- Go to http://www.hibernate.org/
and download Hibernate
- Install
Hibernate by unzipping the
file hibernate-2.1.6.zip to drive
say F:
-
Setup a Project Hierarchy by doing the following Create folder F:hlogin and then create
sub-folders F:hloginsrc and F:hloginlib
- Copy all the contents of F:hibernate-2.1lib to
F:hloginlib
- Copy hibernate2.jar to F:hloginlib
- The
example classes we are going to create are all going to reside in
the folder F:hloginsrccomtalimdemo. Create these sub-folders.
Quick Compile ? To quickly compile your Java code: ? At the folder F:hlogin
type ant
To run your Hibernate programs
At the folder F:hlogin
type ant run
>> Resource: Build.xml
<< Start < Previous 1 2 3 4 5 Next > End >> |