When we are working on web application , we need to deal with DB. And working with both OOPs and Relational DB is bit clumsy and time consuming because of paradigm mismatch between data objects and realtional DB.
Hibernate is solution to this problem. It is a ORM framework which takes care of mapping of java classes to DB tables and provides data query and retrieval facilities.
ORM stands for Object-Relational Mapping (ORM) is a programming technique of mapping data from an object model representation to a relational data model representation (and visa versa).
It simplifies the data creation, data manipulation and data access.
It internally uses the JDBC API to interact with the database.
Hibernate Framework: It is a ORM solution for java web application dealing with RDBMs. It is a open source framework and created in 2001 by Gavin King.
Advantages of Hibernate-
1) Hibernate is open source and light weight framework.
2) Hibernate supports mapping of java classes to database tables and vice versa.
3) Hibernate provides a powerful query language (HQL) that is similar to SQL.
4) Hibernate is fast as cache is used internally in hibernate. First level and Second level cache.
5) Hibernate supports transaction management and make sure there is no inconsistency in data.
6) Hibernate is easy to integrate with other Java EE frameworks.
Download the latest version of Hibernate from http://www.hibernate.org/downloads.
There are several persistent frameworks and ORM options in Java. A persistent framework is an ORM service that stores and retrieves objects into a relational database.
Enterprise JavaBeans Entity Beans
Java Data Objects
Castor
TopLink
Spring DAO
Hibernate