Taking advantage of prepared statement performance

From: "Brett" <brettonator(at)excite(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Taking advantage of prepared statement performance
Date: 2002-10-10 17:30:00
Message-ID: 20021010173000.1186529A46@xmxpita.excite.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I have a web application that invokes java jdbc code for each request. Wouldit be faster if I stored all my prepared statements for each connection, sowhen I want to do a query I a) pull a connection object from the pool thenb) call ps.setX; ps.setY;...; ps.executeQuery(); and not close the preparedstatement? That way, another thread could grab the connection and nothave to recreate the prepared statement. I would associate sets ofprepared statements with connections. Would this be faster thancreating a prepared statement for each web request?I am using 7.1.3b2 (for production *crosses fingers*) in case that matters. Once again thanks for any help and sorry for any formatting issues withthis message.

------------------------------------------------
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

Browse pgsql-jdbc by date

  From Date Subject
Next Message Brett 2002-10-10 17:34:03 Re: Taking advantage of prepared statement performance
Previous Message Barry Lind 2002-10-10 17:08:33 Re: Getting a ResultSet for a refcursor element.