• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDBC-hibernate

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why to use hibernate instead of JDBC?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have all of our objects mapped to database tables. When we start the application it creates all of the tables and relationships and to date I have not written a single line of SQL except from what was required to create the database.
Once mapped, you can do smple operations like select all, select by ID, save, update, delete with a single line of code and you don't need to worry about converting between objects and database attributes as this all gets done for you.
 
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once you master it ...hibernate is more easy ...
lesser code to do .
Hibernate is basically a ORM tool which allows you to perform database activies without bothering about the Database change.

You dont need to change the SQL scripts if you change database.

Apart from that you dont need to write most of the SQL scripts for persisting deleting object and parsing the resultsets.With respect to perfomance hibernate provide the capability to reduce the number of database trips by creating the betch processing and session cache and second level cache.

It also supports the transactions.

More then this all it is very easy to make a cleaner seperation of Data Access Layer from business logic layer.

With all the capabilities mention above it is fast and easy to learn hibernate develop application and maintain easily.


you have your objects in the form of pojos .. using hibernate you can directly persist it to one or multiple tables depending upon your requirements
check these links

comparison
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A couple of quibbles:


It also supports the transactions.


So does JDBC.


More then this all it is very easy to make a cleaner seperation of Data Access Layer from usiness logic layer.


Its also very easy to do the opposite with Hibernate. A data access pattern, irrespective of its implementation, is the way to provide clean seperation.
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


It also supports the transactions.


So does JDBC.

i didn't told that JDBC doesn't !!!

and patterns are always proved ones ...........
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic