• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Design Practice Question - JDBC Access With Spring

 
Ranch Hand
Posts: 193
14
Hibernate Eclipse IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

Another best practice question. How should JDBC access be handled when using Spring? The Spring tutorials I've seen on the subject to date all have separate data access objects for each database object that users might wish to query or update. Traditionally when doing JDBC I've tended to write one Data Access Layer class that handles all JDBC interactions. Is this an outdated approach?

Thanks
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know if it's best practice or not but Spring 4.x (anyway) has that JDBCTemplate thing you may use to set up those CRUD operations similar to a DAO implementation. I believe the DB connection is injected when you use the template.

By the way, I personally haven't use the JDBCTemplate recently.

 
reply
    Bookmark Topic Watch Topic
  • New Topic