Total members 11890 |It is currently Sat Apr 20, 2024 1:19 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     -  
 How to use connection object in jsp     -  
 database connection     -  
 Connection object in jsp     -  
 establish a connection with MySQL in php     -  
 Encrypt connection string     -  
 Mobile to PC connection using Bluetooth     -  
 Connection Reset By Peer     -  
 Bluetooth connection using C# (won't work)     -  



cron





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