You can view the tutorials best in Google Chrome, Mozilla Firefox, Opera, higher version of Internet Explorer

What is Hibernate – Hibernate Introduction

Hibernate » On May 4, 2011 By Sivateja

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.
  • here 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).






By [ Java/J2EE Developer & Web Designer ]
Founder of Java4s.com - Indian, lives in United States. You can contact me at sivateja [at] java4s.com
Follow me on


Comments

32 Responses to “What is Hibernate – Hibernate Introduction”
  1. I don’t normally comment but I gotta say thank you
    for the post on this perfect one :D

  2. java4s says:

    thank you so much Millard Landkamer :-)

  3. dev says:

    thanks a lot for this beautiful post…..

  4. java4s says:

    @dev – You’re welcome

  5. Mohammed vaseem says:

    Very Simple & best way of explaination

  6. Mohammed Vaseem says:

    Hello, In real time applications or projects, where we will be using Hibernate(in terms of SDLC and as well as Application development)?…

  7. Java4s says:

    @Vaseem

    Hibernate is purely for persistence purpose ….!!
    No chance we can use this framework for other purpose.

    Hibernate is only for persistence.

  8. Manoj Ekanayaka says:

    Thank you, easy to understand.

  9. Java4s says:

    @Manoj Ekanayaka

    Thanks for your feedback :-)

  10. Alex says:

    I am a fresher in Java and this example given me clear to understand the flow of program.

  11. bobby says:

    Excellent tutorial…

  12. Java4s says:

    @Alex,@Bobby

    Glad to hear that its helped you, thanks for your feedback.

  13. Regu says:

    Nice Tutorial..

  14. karthic says:

    what is the meaning of persistence?

  15. Java4s says:

    @karthic

    Persistence : Continuous and connected period of time to the database.

  16. 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.

  17. Bhaskar says:

    Dear sir i want struts1.x tutorial please kindly consider my request and send me the respected tutorial sir.

  18. Kondal Reddy says:

    Yeah iT’s clear, Very Usefull, Thnqz a Ton :)

  19. Sanjeev Srivastava says:

    Good Tutorials I like very much..

  20. very good tutorials.. Its very helpful for us

  21. nage says:

    difference between hibernate 2 & 3?

  22. Arun says:

    Respected sir, by this tutorial we came to know that Hibernate is introduced due to overcome the problems of JDBC but in the case of .net we also have N-hibernate as it is the remake of hibernate then we dont have JDBC in dotnet then how come you say that hibernate is introduced due to overcome the limitations of JDBC and Hibernate is an ORM which is used to solve the miss-match problems between object and relational database.

  23. APPARAO PARA says:

    It’s good tutorial and easy way to learn hibernate

  24. It is a nice a tutorial it help me to be a familiar with hibernate….

  25. vani says:

    this article is soo clear thanks for you

  26. Karthi says:

    excellent post to understand Hibernate. thanks a lot for this nice precentation.

  27. Govardhanreddy says:

    Very good article. It is very helpful to the beginners.

  28. govind says:

    nicely explained…..rreally like this sir

  29. govind says:

    nice one sir….

  30. suri says:

    hi, really superb , simple and easy way to understand…thank you so much.. i request u to please explain complete hibernate in the same way to all of us… i request u to please send me the complete tutorial ..thanks

  31. Varun says:

    Nice Explanation of each and every part… Great Work !!!

  32. Yogesh Mude says:

    whatever article u have kept in site its very useful for all java people…
    and in simple language it means easy to understand for java begineers…

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links
Current & UpComing Tutorials
Sitemap :
spring Hibernate struts Json Ajax Log4j Log4j coreJava Servlets Web Services


Upcoming
  Web Services [ In Progress ], JSP
Facebook_Java4s  Twitter_Java4s  GooglePlus_Java4s  Youtube_Java4s 
© 2010 - 2014 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.