commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raffaele Spazzoli <>
Subject feature addition proposal: disconnected jdbc statement
Date Fri, 18 Nov 2005 15:35:50 GMT

I've developed a class library to allow use of jdbc statements
(Statement, PreparedStatement, CallableStatement) in a disconnected
environment (i.e. a situation where a jdbc connection is not available).
This library can be thought as the counterpart of the CachedResultSet
class. I believe this library (about 6 classes) could be hosted in the
common-dbutils project. Please let me know if you are interested.

More in detpth:

Why this library can be useful: I think this library is enough general
to be used is projects outside mine. In my project (an ESB like very
customized for a customer) I have a situation where a mapping between
messages occur faraway from the connection handling. For managing the
case when the connection is of jdbc type I had to develop this library.

The usage pattern is like the following:

Disconnected phase:

statement=DisconnectedStatementFactory.prepareDisconnectedStatement("select * from SYS.SYSTABLES
where TABLETYPE=?");

connected phase:

      ResultSet resultset=statement.executeQuery(); 

disconnected phase:"resultset: "+resultset.toString());

It's not possible to call all the statement methods' during the
disconnected phase. Basically callable methods are the ones returning
void. The inner working is that called methods are memorized and called
in the correct sequence when setConnected() is invoked.
Result set returned during the connected phase are all of
CachedResultSet type and thus can be used in a disconnected environment.
Also out parameter of callable statement are handled.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message