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

ORM and JDBC

vijayaraghava mutharaju
Greenhorn

Joined: Nov 04, 2005
Posts: 14
Hi,

This could be a newbie question on ORM but bear with it.I want to know the additional benefits that of using ORM(tools) over JDBC.Some of things I found out are
1)we can use normal save,load and Hibernate(eg.) converts them automatically using SQL queries.
2)It provides support to store associations between classes.
3)Makes overall handling of the databases easier & improves performance.


Thank you.
Pj Murray
Ranch Hand

Joined: Sep 24, 2004
Posts: 194
There's a blog posting here with a comparison of these Java persistence technology choices here:

http://www.codefutures.com/weblog/corporate/archives/2005/02/data_persistenc.html

Also, in relation to your question on ORM, you should might like to read a blog entry on "Choosing a data persistence strategy":


http://www.codefutures.com/weblog/andygrove/archives/2005/01/choosing_a_java.html

I should point out that there's generally too much attention paid to the choice of Java persistence technology (e.g. Hibernate versus JDO) and not enough on the overall architectural strategy.

While using an ORM technology has benefits, you should also always consider using Data Access Objects - which will provide you with a level of independence from the technology choice (i.e. you can swap between ORM or JDBC or whatever as appropriate). This might be useful:

http://www.codefutures.com/weblog/andygrove/archives/2005/02/data_access_obj.html


PJ Murray -
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

"Makes overall handling of the databases easier & improves performance."

I wouldn't necessarily say that it improves performance, and some out there can argue that it doesn't make handling databases easier.

What I think the main thing is that it removes Database specific information from your code, like SQL text. But in some cases you still want to use SQL through an ORM so that it is faster there, and the query is a simple query for like say a lookup.

I personally like the ability to use OO and Objects when dealing with things that represents tables in a database. I don't like dealing with JDBC directly, and ResultSets and Statements, etc. But others are fine with it.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Magesh Lakshmi
Greenhorn

Joined: Nov 02, 2005
Posts: 10
JDBC Vs ORM [ in particular Hibernate ]
---------------------------------------

1. Query by example [ Criterial queries ]
2. Substituting the whole object as parameter to the query
3. Ease of persisting dependency
4. Automapping of result set to objects
5. Pagination
6. Polymorphic queries
7. Implicit joins .. Eg bid.item.category
8. Detached persistence

Note :- JDBC is good at read-only data. So if you are planning to you projections in Hibernate, you should give a shot to JDBC first, definitely faster than projections.

and so many.


Mag
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORM and JDBC
 
Similar Threads
Object Relational Mapping Help
unsaved-value
how to cast String to Clob ?
how to get a the data of the first row?
Update Single value in a row