commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <>
Subject [dbutils] Current Status
Date Tue, 11 Mar 2003 19:26:04 GMT

It is report about code I added last week and status:

1.Handler interface is changed and moved to the main package.
2.Added dependancy on QDox.
3. Added ProcedureUtils.

ProcedureUtils is utils is factory for DAO.
DAO are declared as interfaces with metadata (custom javadoc tags).
Implementation for DAO is generated at runtime, source code file is used as
resource for metadata at runtime.
Callbacks are invoked to handle result sets (ResultSetHandler interface
implementation). Predefined hanlers used for the most common and trivial
Parametrezed and dynamic SQL is supported.

public interface DAO{

     *@query SELECT  COUNT(1) > 0 FROM {0} WHERE ID=$1
    public boolean exists( String tableName, int id );


{0} - dynamic SQL parameter
 $1  - parametrezed SQL parameter


//generates implementation from class object and source file
 DAO dao = ( DAO)ProcedureUtils.getInstance( DAO.class, connection);

//executes query: "SELECT  COUNT(1) > 0 FROM TABLE_NAME WHERE ID=?"

 if( dao.exists( "TABLE_NAME" , 0 ) ){

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

View raw message