• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When should I use JDBC and when to use Hibernate

 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems like I have 4 choices of technology of database access in Java:

1. Hibernate
2. JDBC
3. Entity Beans
4. Ensity Bean container

It seems like Hibernate is the right answer. Do you agree?

-- Kaydell
[ November 25, 2006: Message edited by: Kaydell Leavitt ]
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kaydell,
It depends on your requirements. There are almost never absolutes about always using a given technology. For example, if you were doing a single complex query, Hibernate would be overkill.
 
Kaydell Leavitt
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't seem to figure out how to implement UTF-16 CHARS using JDBC.

Does Hibernate serialize objects and then allow the resulting data to be stored in a JDBC database?

I worry about serializations that are stored on a disk or that may become different between client and server such as might be the case when using RMI. Is serialization a problem and does Hibernate use it to map objects into a relational database?

-- Kaydell
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kaydell,
Since this wound up being more about Hibernate than JDBC, I'm going to move the thread to our O/R forum. They know more about Hibernate and can give you the specifics.
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmmm. why is my response here ? was intended for another post.

pascal
[ November 27, 2006: Message edited by: pascal betz ]
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JDBC is good for quick-and-dirty, but ORM is generally preferable for larger, more complex projects. Interestingly enough, even though the ORM projects normally are using JDBC as their underlying access method, benchmarks indicate that they tend to be more efficient than raw JDBC. Like assembly languages vs. HLLs. It may sound paradoxical, but I've seen more than my share of horribly inefficient assembly algorithms used simply because writing a smarter one takes too long.

No, Hibernate isn't using serialization, BTW. It's using JDBC. Part of the Hibernate functionality is to establish a mapping between data objects and SQL objects in the backing database, generate the SQL code needed to access and modify it, and manage the execution of that process.

Just to repeat something I said the other day, however, do try and minimize the number of programs modifying the database at the same time. If only one app changes the data, there's never any question which app is misbehaving.
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
see my post above. something went wrong here.
Pascal
[ November 27, 2006: Message edited by: pascal betz ]
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JDBC is good for quick-and-dirty, but ORM is generally preferable for larger, more complex projects. Interestingly enough, even though the ORM projects normally are using JDBC as their underlying access method, benchmarks indicate that they tend to be more efficient than raw JDBC. Like assembly languages vs. HLLs. It may sound paradoxical, but I've seen more than my share of horribly inefficient assembly algorithms used simply because writing a smarter one takes too long.

No, Hibernate isn't using serialization, BTW. It's using JDBC. Part of the Hibernate functionality is to establish a mapping between data objects and SQL objects in the backing database, generate the SQL code needed to access and modify it, and manage the execution of that process.

Just to repeat something I said the other day, however, do try and minimize the number of programs modifying the database at the same time. If only one app changes the data, there's never any question which app is misbehaving.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic