This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

JDBC-hibernate

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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 ...........
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!