Total members 10262 | Gratitudes |It is currently Thu May 24, 2012 10:11 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 2 posts ] 
Author Question
 Question subject: Closing connection in jsp
PostPosted: Wed Oct 22, 2008 12:49 am 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:47 pm
Posts: 281
Has thanked: 0 time
Have thanks: 1 time

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...


TOP
 Profile Send private message  
Reply with quote  
 Question subject: Re: Closing connection in jsp
PostPosted: Wed Oct 22, 2008 12:51 am 
Offline
Proficient
User avatar

Joined: Sun Oct 19, 2008 3:53 pm
Posts: 229
Has thanked: 0 time
Have thanks: 0 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.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 2 posts ] 
Quick reply


  

 Similar topics
 error closing file matlab save
 Bluetooth connection using C# (won't work)
 database connection
 connection is not making
 How to use connection object in jsp
 Connection object in jsp
 GeoCities is closing
 Encrypt connection string
 HTTP POST msg connection close problem
 Connection Reset By Peer

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: No registered users and 1 guest



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team