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
cus on that first. That quick change will be your first
increase in performance.
Hope this helps some.
Chris Berthold
-Original Message-
From: IT Desk [mailto:[EMAIL PROTECTED]
Sent: Monday, December 04, 2006 2:04 PM
To: Tomcat Users List
Subject: jsp optimization for db driver load a
-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
This isn't Tomcat specific but general to any jsp container and its jvm.
I am working on a site where almost everything is done through the jsp
page plus one main java class to store state data.
The site's jsp page may do up to 7 queries on the database. On each
query, the statements are thes