[OT] JDBC confusion

2003-08-14 Thread john-paul delaney
Hello List... newbie question coming up: If I set up a jdbc connection object in one servlet, do I have to close it each time or can the same connection be re-utilized by other servlets each using a different sql statement (perhaps storing the connection as a session attribute?). Is there a si

Re: [OT] JDBC confusion

2003-08-07 Thread Andrew Geery
The "preferred" way of doing this is to use connection pooling. The primary reasons are scalability, speed and simplicity. If you have 5,000 people using your app at the same time, by your method you will have to have 5,000 connections to the database (one per user) stored in the various sessio

Re: [OT] JDBC confusion

2003-08-14 Thread Nikola Milutinovic
> Hello List... newbie question coming up: Phaser charged... Shields at 80%... Photon torpedos loaded... > If I set up a jdbc connection object in one servlet, do I have to close it each time > or can the same connection be re-utilized by other servlets each using a different > sql statement (per

Re: [OT] JDBC confusion

2003-08-14 Thread Jon Wingfield
I agree with Nix, use a connection pool. One connection per user may be ok when you've got, say, 5 concurrent users but when you've got 1000, 1, Not scalable. http://tomcatfaq.sourceforge.net/database.html http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.htm