Package rife.database
Class DbPreparedStatementHandler<DataType>
java.lang.Object
rife.database.DbResultSetHandler
rife.database.DbPreparedStatementHandler<DataType>
- All Implemented Interfaces:
Cloneable
,PreparedStatementHandler
public abstract class DbPreparedStatementHandler<DataType>
extends DbResultSetHandler
implements PreparedStatementHandler
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
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetData()
void
performQuery
(DbPreparedStatement statement) int
performUpdate
(DbPreparedStatement statement) void
setParameters
(DbPreparedStatement statement) Methods inherited from class rife.database.DbResultSetHandler
clone, concludeResults, createStatement, getPreparedStatement
-
Field Details
-
data_
-
-
Constructor Details
-
DbPreparedStatementHandler
public DbPreparedStatementHandler() -
DbPreparedStatementHandler
-
-
Method Details
-
getData
-
setParameters
- Specified by:
setParameters
in interfacePreparedStatementHandler
-
performUpdate
-
performQuery
-