• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Overview of Java Database coding paradigms

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wonder if my Java colleagues would agree with or have comments on the following outline of the three paradigms of working with relational databases:
• JPA/Hibernate Repositories, annotated and autowired, with implicit methods that you don’t even have to write.
This is the latest paradigm, simplest to code.
Cons: You have limited control over HOW it does what it does; debugging is opaque and difficult; performance may be compromised; some senior managers may prohibit you from using this.
• JDBCTemplates: More explicit SQL coding
Pros: Better control; easier to debug; may perform better
Cons: More code to write
• Classic JDBC: DataSource, Connection, Statement, PreparedStatement, CallableStatement, ResultSet
Skip this if you think you’re never going to work in such a “retro” paradigm.
Pros: Tried and true;  maximum control and performance
Cons: Maximum tedium coding low-level details.
Posts: 1175
IBM DB2 Netbeans IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice question for a debate, added a couple of flags.
My two cents: for various reasons, I had and currently have to work with pure jdbc, but at the very end I need to write some helper classes to reduce boilercode you inevitably need to write when using prepared statements, result sets and so on. Personally I'd follow JPA, and I would not rely to much upon Spring data facilities. Spring is really really good, but tends IMHO to automagically do too much things, and most of times I needed more control over data access.
You have to be odd to be #1 - Seuss. An odd little ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!