Pooling Prepared Statements - Mailing list pgsql-jdbc

From G.Nagarajan
Subject Pooling Prepared Statements
Date
Msg-id NFBBIOPECKPCJJHHBOGJAEKEDGAA.gnagarajan@dkf.de
Whole thread Raw
In response to Re: JDBC sources  (Dave Cramer <Dave@micro-automation.net>)
List pgsql-jdbc
hi,
i am planning to implement a pooling system for Prepared Statements.
It will open a single connection during initialization and create
many prepared statements using this connection. The connection will
be always kept open so that the prepared statements are valid. To
speed up things, there may be more than one prepared statement for
the same query, ie,

stmt1 = "select from table where field = ?";
stmt2 = "select from table where field = ?";

Will there be any issues when two statements are executed for the
same table using the same connection? has anyone tried doing something
like this or is there any open source tool which can do this?

This will greatly improve the efficiency of the system as most of the time,
the connections are used for executing the same statements. Pooling the
statements instead of the connection will save the processing needed
for creating the statement objects for every query.

Regards,
Nagarajan.


pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: JDBC sources
Next
From: João Paulo Caldas Ribeiro
Date:
Subject: Re: Pooling Prepared Statements