Limitations of JDBC
- JDBC is
dependent upon
theDatabase
being using - JDBC code is
not portable
across the multiple database softwares - In JDBC,
Exception handling
is mandatory - While working with JDBC, There is
no support Object level relationship
.
Hibernate Framework
Hibernate is a framework which provides some
abstraction layer
means programmer dont have to worry about the implementations, Hibernatedo implementations
for youinternally
like Establishing aconnection
with the database, writing query to performCRUD
operations 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 database
software 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 manually
we have to create table and declare the data-type for each and every column. ButHibernate
can doDDL operations
for youinternally
likecreation
of table,drop
a table,alter
a 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 Memory
whereas JDBC does not support cache memory. - Hibernate is a
ORM tool
means it support Object relational mapping, in hibernateeach record
is represented asa Object