org.midao.jdbc.core.statement
Interface StatementHandler

All Known Implementing Classes:
BaseStatementHandler, CallableStatementHandler, LazyStatementHandler

public interface StatementHandler

Statement Handler is responsible for setting and reading values from java.sql.Statement


Method Summary
 void afterClose()
          Function is invoked after Connection is closed.
 void beforeClose()
          Function is invoked before Connection is closed.
 java.lang.Object[] readStatement(java.sql.Statement statement, QueryParameters params)
          The purpose of this function is to read all OUT/INOUT parameters from Statement and return them as Array.
 void setStatement(java.sql.Statement statement, QueryParameters params)
          Sets Query input Parameters into @statement Invoked only when @statement is instance of PreparedStatement or CallableStatement
 java.util.List<QueryParameters> wrap(java.sql.Statement stmt)
          Reads all Statement output - Generated Keys, Result sets and wraps them into List.
 

Method Detail

setStatement

void setStatement(java.sql.Statement statement,
                  QueryParameters params)
                  throws java.sql.SQLException
Sets Query input Parameters into @statement Invoked only when @statement is instance of PreparedStatement or CallableStatement

Parameters:
statement - sql Statement
params - Query input Parameters
Throws:
java.sql.SQLException

wrap

java.util.List<QueryParameters> wrap(java.sql.Statement stmt)
                                     throws java.sql.SQLException
Reads all Statement output - Generated Keys, Result sets and wraps them into List. First element should always be added to keep some technical values (update count etc.).

Parameters:
stmt - sql Statement
Returns:
All output returned by sql Statement
Throws:
java.sql.SQLException

readStatement

java.lang.Object[] readStatement(java.sql.Statement statement,
                                 QueryParameters params)
                                 throws java.sql.SQLException
The purpose of this function is to read all OUT/INOUT parameters from Statement and return them as Array. Returned array size is equals @params.size(). Every non OUT parameter should be set as null value

Parameters:
statement - sql Statement
params - input QueryParameters
Returns:
array of out parameters(and null for in)
Throws:
java.sql.SQLException

beforeClose

void beforeClose()
                 throws java.sql.SQLException
Function is invoked before Connection is closed. In here local variables can be released

Throws:
java.sql.SQLException

afterClose

void afterClose()
                throws java.sql.SQLException
Function is invoked after Connection is closed. In here local variables can be released

Throws:
java.sql.SQLException


Copyright © 2013. All Rights Reserved.