• 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
Sheriff
Posts: 36031
432
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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!