Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling

 
J Craig
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using a datasource is it best to have one class that does all database access or is it best to have a seperate object for each type of request to database(update,delete,etc).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's mostly a matter of personal preference. I like to have one class for each query or update with the common connection stuff in a superclass. That way the database classes don't get huge. If you only have a couple queries, it probably doesn't matter either way.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic