org.clazzes.util.aop.jdbc
Interface JdbcStatementAction<T>
public interface JdbcStatementAction<T>
This interface encapsulates JDBC code, which is executed as part of a
DAO. This way, the given statement can be closed in a finally clause
and any SQLException may be encapsulated by a DAOException
.
If your action does not return a value, parameterize it with Void
and return null
from your implementation.
Method Summary |
T |
perform(Statement statement)
Run a piece of JDBC code inside a context, where a statement has
been set up. |
perform
T perform(Statement statement)
throws Exception
- Run a piece of JDBC code inside a context, where a statement has
been set up.
- Parameters:
statement
- A JDBC statement, which will be closed upon the finalization of
this method.
- Returns:
- The result of the DAO operation or
null
.
- Throws:
Exception
- Upon errors. This exception will be wrapped by a DAOException
.
Copyright © 2013. All Rights Reserved.