Win a copy of Microservices Testing (Live Project) this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

ORM and JDBC

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic