Miller, Steve wrote:
Connection conn = ds.getConnection();
Statement stmt =
conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery(query1);
//run iterator loop and di
Thanks to everyone for the replies. I had kinda been hoping the
connection pooling was somehow automatic with the latest version of Tomcat.
I'll pass along the information to the decision-makers About 15-20 jsps
would need to be changed. There's another 30 jsps but they are not high
use (ad
Ugh. Model 1 architecture :-)
Connection pooling is the way to go here, definitely. Setup Tomcat to do
it for you automatically on startup. Then, just grab a connection from
the pool when you need it. Some good documentation on setting up and
configuring Tomcat to do that is at
http://tomcat.apach
My suggestions are as follows:
1. Create a ServletContextListener and load the Class.forName in the
contextInitialized method. I'm not 100% sure of the performance penalty
on your creating the driver object over and over. I'm going to assume
it's a static object so it only initializes once but d
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Coral,
IT Desk wrote:
> The site's jsp page may do up to 7 queries on the database. On each
> query, the statements are these:
>
> Driver DriverDB = (Driver)Class.forName(db_DRIVER).newInstance();
You should certainly skip this step. You can do it o
You'll have to do something because the below code is very inefficient.
Creating and closing connections is an extremely expensive operation and
the way this is written you're getting one on every request.
At minimum, I would recommend a ServletContextListener that creates a
pooled DataSource
I doubt there is connection pooling when you use the driver directly. There
is connection pulling if you use java...DataSource I think. If you store the
connection object in session then I suppose you could reuse it. Still using
a DataSource implementation that does connection pooling is better. C