Total members 11893 |It is currently Tue Nov 05, 2024 11:41 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi,
I am developing web application and i need a advice. I have opened a lot of
db connections in my classes and everytime i do not want to write
resultset.close() vs in my classes so i have written a static method which
close my db connection. Whenever i need to close db connection I call this
method. Do you think it is the best approach to close db connections or do
you have better solutions.
Thanks...




Author:
Proficient
User avatar Posts: 280
Have thanks: 1 time

However, if you're working with a web application, have you thought of
using Connection Pooling? Typically, the pool sets up a Data Source
object in the JNDI tree. When you want a connection, you call the data
source to get a connection. Your static method returns the connection to
the pool.

This interface is typically done in a single database interface class.
This class has methods to do selects, inserts, etc., and these methods
typically deal with connections, so most of the program knows nothing
about them.

_________________
Please recommend my post if you found it helpful


Author:
Proficient
User avatar Posts: 228
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : Closing connection in jsp
 GeoCities is closing     -  
 error closing file matlab save     -  
 Connection object in jsp     -  
 How to use connection object in jsp     -  
 database connection     -  
 Encrypt connection string     -  
 Mobile to PC connection using Bluetooth     -  
 Connection Reset By Peer     -  
 Bluetooth connection using C# (won't work)     -  
 Using java in http connection     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com