File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC-hibernate

 
ash surve
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why to use hibernate instead of JDBC?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • 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.
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • 0
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • 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 Java Tomcat Server
  • 0
  • 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 ...........
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic