org.clazzes.util.aop.jdbc
Interface JdbcPreparedStatementAction<T>


public interface JdbcPreparedStatementAction<T>

This interface encapsulates JDBC code, which is executed as part of a DAO. This way, the given prepared 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(PreparedStatement statement)
          Run a piece of JDBC code inside a context, where a prepared statement has been set up.
 

Method Detail

perform

T perform(PreparedStatement statement)
          throws Exception
Run a piece of JDBC code inside a context, where a prepared statement has been set up.

Parameters:
statement - a prepared statement.
Returns:
The result of the DAO operation or null.
Throws:
Exception - Upon errors. This exception will be wrapped by a DAOException.


Copyright © 2012. All Rights Reserved.