• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JPA or JDBC

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What would you choose for what kind of project? JPA or JDBC?

Thanks.
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If a project needs faster database access and all it is doing is straight updates to database, going against jdbc and doing batch updates are faster.

On the other hand, if you are frequently accessing data and need a layer to cache data, I would personally prefer JPA or any other OR layer.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, if i wouldn't go for JPA/Hibernate, i'd prefer iBatis over plain JDBC.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The question can almost be generalized to "when should you use a framework, and when shouldn't you?"

Simple and straight forward apps probably don't need a framework. As things get more complicated, and management of the application over time and change becomes more important, a framework, like JDO or hibernate, becomes more and more helpful.

-Cameron McKenzie
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i will give diffent answer in diffent situatiion,for example,maybe some small and simple project i will choose ibatis or jdbc,big but not enough i think jpa will work well,and big project i think hibernate is a good choice
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Besides performance, I would take into account the database model. Mainly in legacy databases, you may find unnormalized tables, poor referential integrity and other aberrations that JPA does not fit. If you choose JPA in these cases, you will probably solve problems coding SQL queries instead of taking advantage of the framework.
 
My, my, aren't you a big fella. Here, have a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic