| Author |
approach other than connection pooling
|
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
What is best approach for writing database operation in web application if you are not going for connection pooling? Thanks.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
The is not likely to be any difference in the code, but your code is probably going to use up more database resources, since a Connection will actually equal a connection to the database, rather than sharing connections in the way connection pooling does it. I suppose if you didn't want to use connection pooling you could try to write your code to share connections. But why bother? There are plenty of connection pool implementations out there, why reinvent the wheel?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26173
|
|
Originally posted by ankur rathi: What is best approach for writing database operation in web application if you are not going for connection pooling?
I guess that would just mean that you have your own connection factory that always creates a new connection. Make sure to close the connection when you are done so you don't have a resource leak.
|
[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
|
 |
 |
|
|
subject: approach other than connection pooling
|
|
|