com.uwyn.rife.database
Class DbPreparedStatementHandler<DataType>

java.lang.Object
  extended by com.uwyn.rife.database.DbResultSetHandler
      extended by com.uwyn.rife.database.DbPreparedStatementHandler<DataType>
All Implemented Interfaces:
Cloneable

public abstract class DbPreparedStatementHandler<DataType>
extends DbResultSetHandler

By extending this class it's possible to easily customize the behaviour of a large number of methods in the DbQueryManager class.

You're able to set the parameters of a DbPreparedStatement before the actual execution of any logic by overriding the setParameters method.

If you need to customize the entire query execution, you can override the performUpdate and performQuery methods. Note that these methods are actually responsible for calling the setParameters method, so if you override them you either have to call this method yourself or include the code in the overridden method.

This class has both a default constructor and one that can take a data object. This can be handy when using it as an extending anonymous inner class when you need to use variables inside the inner class that are cumbersome to change to final in the enclosing class.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)
See Also:
DbPreparedStatement, DbQueryManager

Field Summary
protected  DataType mData
           
 
Constructor Summary
DbPreparedStatementHandler()
           
DbPreparedStatementHandler(DataType data)
           
 
Method Summary
 DataType getData()
           
 void performQuery(DbPreparedStatement statement)
           
 int performUpdate(DbPreparedStatement statement)
           
 void setParameters(DbPreparedStatement statement)
           
 
Methods inherited from class com.uwyn.rife.database.DbResultSetHandler
clone, concludeResults, createStatement, getPreparedStatement
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mData

protected DataType mData
Constructor Detail

DbPreparedStatementHandler

public DbPreparedStatementHandler()

DbPreparedStatementHandler

public DbPreparedStatementHandler(DataType data)
Method Detail

getData

public DataType getData()

setParameters

public void setParameters(DbPreparedStatement statement)

performUpdate

public int performUpdate(DbPreparedStatement statement)

performQuery

public void performQuery(DbPreparedStatement statement)


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.