com.ibatis.sqlmap.engine.mapping.statement.SelectStatement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ibatis-enhanced Show documentation
Show all versions of ibatis-enhanced Show documentation
some enhanced features added for ibatis.
package com.ibatis.sqlmap.engine.mapping.statement;
import java.sql.SQLException;
import java.util.List;
import com.ibatis.common.jdbc.exception.NestedSQLException;
import com.ibatis.sqlmap.engine.scope.StatementScope;
import com.ibatis.sqlmap.engine.transaction.Transaction;
import com.ibatis.sqlmap.engine.transaction.TransactionException;
public class SelectStatement extends MappedStatement {
@Override
public StatementType getStatementType() {
return StatementType.SELECT;
}
@Override
public int executeUpdate(
StatementScope statementScope, Transaction trans,
Object parameterObject)
throws SQLException {
throw new SQLException(
"Select statements cannot be executed as an update.");
}
@Override
public List executeQueryForList(
StatementScope statementScope, Transaction trans,
Object parameterObject,
int skipResults, int maxResults) throws SQLException {
try {
Limited10KRowHandler rowHandler = new Limited10KRowHandler(
this, statementScope, parameterObject);
executeQueryWithCallback(statementScope, trans.getConnection(),
parameterObject, null, rowHandler,
skipResults, maxResults);
return rowHandler.getList();
} catch (TransactionException e) {
throw new NestedSQLException(
"Error getting Connection from Transaction.", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy