What is Hibernate – Hibernate Introduction
|
Hibernate »
On May 4, 2011 | { 18 Comments }
|
Tweet
|
In this tutorial am going to explain, why Hibernate came into picture though we have JDBC for connecting to the database, and what is this hibernate frame work first let us see what are the draw backs of JDBC
Draw Backs of JDBC:
- In JDBC, if we open a database connection we need to write in try, and if any exceptions occurred catch block will takers about it, and finally used to close the connections.
- Hear as a programmer we must close the connection, or we may get a chance to get our of connections message…!
- Actually if we didn’t close the connection in the finally block, then jdbc doesn’t responsible to close that connection.
- In JDBC we need to write Sql commands in various places, after the program has created if the table structure is modified then the JDBC program doesn’t work, again we need to modify and compile and re-deploy required, which is tedious.
- JDBC used to generate database related error codes if an exception will occurs, but java programmers are unknown about this error codes right.
- In the Enterprise applications, the data flow with in an application from class to class will be in the form of objects, but while storing data finally in a database using JDBC then that object will be converted into text. Because JDBC doesn’t transfer objects directly.
In order to overcome above problems, Hibernate came into picture..!
What is Hibernate:
Hibernate is the ORM tool given to transfer the data between a java (object) application and a database (Relational) in the form of the objects. Hibernate is the open source light weight tool given by Gavin King, actually JBoss server is also created by this person only.
Hibernate is a non-invasive framework, means it wont forces the programmers to extend/implement any class/interface, and in hibernate we have all POJO classes so its light weight.
Hibernate can runs with in or with out server, i mean it will suitable for all types of java applications (stand alone or desktop or any servlets bla bla.)
Hibernate is purely for persistence (to store/retrieve data from Database).
|



I don’t normally comment but I gotta say thank you
for the post on this perfect one
thank you so much Millard Landkamer
thanks a lot for this beautiful post…..
@dev – You’re welcome
Very Simple & best way of explaination
Hello, In real time applications or projects, where we will be using Hibernate(in terms of SDLC and as well as Application development)?…
@Vaseem
Hibernate is purely for persistence purpose ….!!
No chance we can use this framework for other purpose.
Hibernate is only for persistence.
Thank you, easy to understand.
@Manoj Ekanayaka
Thanks for your feedback
I am a fresher in Java and this example given me clear to understand the flow of program.
Excellent tutorial…
@Alex,@Bobby
Glad to hear that its helped you, thanks for your feedback.
Nice Tutorial..
what is the meaning of persistence?
@karthic
Persistence : Continuous and connected period of time to the database.
org.springframework.orm.hibernate.HibernateTemplate is a helper class which provides different methods for querying/retrieving data from the database. It also converts checked HibernateExceptions into unchecked DataAccessExceptions.
Dear sir i want struts1.x tutorial please kindly consider my request and send me the respected tutorial sir.
Yeah iT’s clear, Very Usefull, Thnqz a Ton