File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Connection Pooling" Watch "Connection Pooling" New topic
Author

Connection Pooling

J Craig
Greenhorn

Joined: May 04, 2004
Posts: 15
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 26192
    
  66

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Connection Pooling
 
Similar Threads
Sorting a table based on a column
If and else statements in SQL Query
Prevent duplicate data entry
Obtaining auto created id upon finishing insert
JDBC......Driver ....