Limitations of JDBC
- JDBC is
dependent upontheDatabasebeing using - JDBC code is
not portableacross the multiple database softwares - In JDBC,
Exception handlingis mandatory - While working with JDBC, There is
no support Object level relationship.
Hibernate Framework
Hibernate is a framework which provides some
abstraction layermeans programmer dont have to worry about the implementations, Hibernatedo implementationsfor youinternallylike Establishing aconnectionwith the database, writing query to performCRUDoperations etc.
It is a java framework which is used to develop
persistence logic. Persistence logic means to store and process the data for long use. More precisely Hibernate is a open source, non-invasive, light-weightjava ORM(Object relational mapping)framework to develop objects which isindependent of the databasesoftware and make independent persistence logic in all J2EE platform.
Additional Functionalities supported by Hibernate framework
- Hibernate framework support
Auto DDL(Data Defination Language)operations. InJDBC manuallywe have to create table and declare the data-type for each and every column. ButHibernatecan doDDL operationsfor youinternallylikecreationof table,dropa table,altera table etc. - Hibernate supports
Auto Primary key generation. It means in JDBC we have to manually set a primary key for a table. But Hibernate can this task for you. - Hibernate framework is independent of Database because it supports
HQL (Hibernate Query Language)which is not specific to any database, whereas JDBC is database dependent. - In Hibernate,
Exception Handling is not mandatory,whereas In JDBC exception handling is mandatory. - Hibernate supports
Cache Memorywhereas JDBC does not support cache memory. - Hibernate is a
ORM toolmeans it support Object relational mapping, in hibernateeach recordis represented asa Object