Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training

jdbc vs hibernate

In this section, you will learn why hibernate is better option than using JDBC.

Ads

Tutorials   
How to write hello world example program in Hibernate? How to create one to one relationship in Hibernate 4 with Annotation? How to calculate minimum in Hibernate using the min() Function Hibernate 4.3.4 Released: Hibernate 4.3.4.Final Maven dependency Hibernate 4.3 Hello World: Example How to create SessionFactory in Hibernate 4.3.1? Hibernate 4 Hello World: Example of Hello World program Hibernate 4 create Session Factory: Example of creating Session Factory in Hibernate 4 Hibernate 4.3 and JPA 2.1 Example What is Hibernate in Java? Hibernate Overview and Architecture What is JPA 2.1? Hibernate 4.3.0.Final Maven dependency Hibernate 4.3 ORM Features Hibernate 4.3 Tutorial Hibernate Criteria average example Hibernate Criteria load all objects from table Hibernate Criteria Hibernate beginner tutorial Hibernate Session.delete() Example Hibernate save or update method example Hibernate Load Example Hibernate save Example - Rose India Hibernate 4 tutorials Hibernate Example Step by Step in Eclipse Hibernate Configuration files Setup Hibernate Environment Hibernate Architecture Hibernate Overview Hibernate 4.2 Tutorial Hibernate 4 Annotations Tutorial Hibernate 4 AnnotationSessionFactoryBean hibernate versions hibernate jndi hibernate tomcat hibernate metamodel generator hibernate entity Seam Hibernate C3P0 Hibernate hibernate shard hibernate means temporal hibernate jsf hibernate spring j2ee hibernate spring hibernate encrypted password alias_to_entity_map hibernate temporal jsf spring hibernate hibernate by example hibernate repository hibernate sample code
Ads

jdbc vs hibernate

In this section, you will learn why hibernate is better option than using JDBC.

JDBC HIBERNATE
Need manual mapping for an object model's data representation to a relational data model. Hibernate has its own efficient ORM feature which take care of the mapping itself using XML files.
You need to write query for database connection explicitly.  Hibernate automatically connect to the database by using the XML configuration file. 
JDBC supports SQL only. Developers need to explicitly write the whole query and choose according to your need. Hibernate supports HQL(Hibernate query language) and native SQL.
In JDBC, mapping between two tables needs to write lots of codes and query. And if there is change in database or table, you need to change the code and the query as well. In Hibernate, the mapping between two tables done through the XML or annotation and if there is a change in database or in any table, you need to change the XML file or annotated  model  class.
In JDBC, caching is maintained through code written explicitly. In Hibernate, cache is fixed to application work space. The results of the query is move to this cache, so that after some time when user wants to fetch the same record, the cached records can be used. It will also save time.
In JDBC, no check is present which store the updated data information by any user which checks every time data updating occurs. If developer want this type of check, he need to code it himself. In Hibernate, version type field is present, which is enabled by the developer. Each time when database is updated in form of java class object, version type field is updated. So if the same row is retrieved by two peoples and one of them tried to update it, version is automatically updated for this row by Hibernate. When other user tries to update the same row, it will not allow them to update this row because the user contains the data of the row before last updation.

Advertisements

Ads
Share on Google+Share on Google+

jdbc vs hibernate

Posted on: April 7, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Advertisements

Ads
 

Discuss: jdbc vs hibernate  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0

Ads

 

Ads