File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC-hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC-hibernate" Watch "JDBC-hibernate" New topic
Author

JDBC-hibernate

ash surve
Greenhorn

Joined: Aug 19, 2010
Posts: 1
why to use hibernate instead of JDBC?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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

Joined: Jun 07, 2010
Posts: 129

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


VIJINDAS
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129


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
 
subject: JDBC-hibernate