commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Oliver Heger)
Subject [dbutils]QueryInterface
Date Sun, 11 Jan 2004 18:52:35 GMT

I am working on a kind of SQL SELECT generator library. The basic idea 
is that you have an object representing the query to be performed. You 
add objects for the fields to be retrieved and feed it with condition 
objects. Finally it returns a fully initialized PreparedStatement object.

I would now like to use [dbutils] to execute the queries, but I have the 
problem that none of the query() methods of QueryRunner really fits my 
needs because I have already a PreparedStatement. To solve this, would 
it be possible to introduce a Query interface in [dbutils], which could 
look as follows:

public interface Query {
    PreparedStatement getStatement(Connection conn) throws SQLException;

Then there could be an additional query() method in QueryRunner that 
expects such a Query object as argument. It would fetch the statement 
from this object and execute it.

I know that you try to keep [dbutils] small. This interface would not 
really add new functionality to this component, but may extent its 
usage. What do you think?

If there is interest, I can try to provide a patch.


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

View raw message