Advantages of Hibernate over JDBC:

  1. Hibernate is an ORM tool
  2. Hibernate is an open source framework.
  3. Better than JBDC.
  4. Hibernate has an exception translator , which converts checked exceptions of JDBC in to unchecked exceptions of hibernate. So all exceptions in hibernate are unchecked exceptions and Because of this no need to handle exceptions explicitly.
  5. Hibernate supports inheritance and polymorphism.
  6. With hibernate we can manage the data stored across multiple tables, by applying relations(association)
  7. Hibernate has its own query language called Hibernate Query Language. With this HQL hibernate became database independent.
  8. Hibernate supports relationships like One-To-One, One-To-Many, Many-To-One ,Many-To-Many.
  9. Hibernate has Caching mechanism. using this number of database hits will be reduced. so performance of an application will be increases.
  10. Hibernate supports lot of databases.
  11. Hibernate supported databases List.
  12. Hibernate is a light weight framework because hibernate uses POJO classes for data transfer between application and database.
  13. Hibernate has versioning and time stamp feature with this we can know how many number of times data is modified.
  14. Hibernate also supports annotations along with XML.
  15. Hibernate supports Lazy loading.
  16. Hibernate is easy to learn it is developers friendly.
  17. The architecture is layered to keep you isolated from having to know the underlying APIs.
  18. Hibernate maintains database connection pool.
  19. Hibernate  has Concurrency support.
  20. Using Hibernate its Easy to maintain and it will increases productivity


Disadvantages of Hibernate Compared to JDBC!!:
  • Hibernate is slow compared to JDBC because of generating many sql queries at run time but this is not considered as dis advantage in my view.
  • Below are some of the dis advantages but these are not applicable to small applications. But we have given some possible scenarios. 

advantages and disadvantages of hibernate

Instance Of Java

We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
«
Next
Newer Post
»
Previous
Older Post

2 comments for Advantages and disadvantages of hibernate compared to jdbc

  1. Well I saw that we have a lot of advantages, but these advantages could be not as good as people think.

    For Example:

    Lazy loading could generate a lot of lazy loading exceptions when the current session is not connected to the database.
    The HQL is not good enough for all the cases, and in most cases you finish with a lot of complex queries, because the language is not as the native SQL statement.
    From point of view I do not like the inheritance strategies of hibernate, sometimes these strategies overcomplicate the database structure, and if you see the relational work is not a OO work which could have all the benefits of OOP.
    Another concern that I saw in this Article is that JDBC support many more databases than hibernate, because JDBC is the lowest API or the API at the lowest level.
    The connection pool is not a future of hibernate, it is a feature of the JDBC specification and this means that this is not a future of hibernate.
    Hibernate is not easy to learn and this is the reason that you see so many bad implementations of the OOP model with hibernate.

    ReplyDelete
    Replies
    1. Yes.. you are right..performance is a big concern with hibernate..Do you think we can achieve same level of performance in hibernate as JDBC?

      Delete

Select Menu