Java J2EE Portal
Enterprise Java Station
J2EE curve
Java News / Articles
Java News / Articles
JavaOne Update - JavaFX, Java On Linux & Oracle JSF
Java Developer Interview Questions
JavaEE Architecture Using The Spring Framework
Processing...
Buy Java, Deals On Software Technology Store
Click here for great deals on computers, laptops, software and books
Quick Hibernate PDF Print
Written by Satish Talim   
Nov 16, 2004 at 09:34 PM

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




Add This Feed Button

Enter your Email

IndicThreads.com Conference On Java Technology, Pune, India
Java Expert Interviews
HTML 5 WebSocket cracks the HTTP request-response barrier
GraemeRocher-Grails
Grails is a breath of fresh air for Java developers
Mukesh Hegde NCStudio IDE
Java IDE in a brand new avatar. Making development server centric.
Processing...
Go to top of page  Home |
SiteMap

Copyright 2004 to 2008 Rightrix Solutions. All rights reserved. All product names are trademarks of their respective companies. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Rightrix Solutions and IndicThreads.com are independent of Sun Microsystems, Inc.

Views expressed at IndicThreads.com reflect the views of the authors alone, and do not necessarily reflect those of IndicThreads.com. IndicThreads.com and it's authors are not responsible for reader comments and opinions.

Enterprise Java J2EE JEE Portal >> IndicThreads.com