What is Hibernate ?
Hibernate is an open source, lightweight and Java based ORM software to develop
object based Database software independent O-R mapping persistence logic in Java, Jee based applications like Desktop,Web application,Enterprise application.
How to download Hibernate ?
Click here to download Hibernate Software (any version). For this tutorial we are using hibernate 3.2.6. So you can download hibernate3.2.6.ga.zip file and extract it.
Why should we use Hibernate ?
Hibernate is a framework software that is developed based on JDBC having the ability to generate common code of persistence logic dynamically.
Suppose we use JDBC for inserting the records into Database, then we have to follow bellow steps
- Register the JDBC driver with DriverManager .
- Establish the connection with Database Software.
- Crate JDBC Statement object.
- Send and execute INSERT SQL query in database Software.
- Process the result
- Close JDBC object.
- Register the JDBC driver with DriverManager .
- Establish the connection with Database Software.
- Crate JDBC Statement object.
- Send and execute UPDATE SQL query in database Software.
- Process the result
- Close JDBC object.
If we work with framework software like Hibernate most of the common specific logics are developed by Hibernate, so we need to develop only on application specific logics.
Hibernate provides abstraction layer on JDBC. so while developing Hibernate code we never bothered about internally generated JDBC code.
Advantages of Hibernate
- Allow POJO or POJI model programming.
- Allow to develop OR mapping style Database software independent persistence logic.
- gives HQL to develop Database software independent queries.
- Gives built in middle-ware services like Transaction management, Caching.
- Allows to work with third party supplied middle ware services and Web Server and Application Server managed middle ware services.
- it is light weight software to develop OR mapping persistence logic.
- Allows to develop objects based relationships like one-to-one,one-to-many,many-to-one,many-to-many.
- Gives support for annotation as alternate for XML.
No comments:
Post a Comment