@Override
public ResultInterface executeQuery(int maxRows) throws SQLException {
checkParameters();
synchronized (session) {
int objectId = session.getNextId();
ResultRemote result = null;
prepareIfRequired();
try {
ResultTransfer transfer = new ResultTransfer(null, null);
result = new ResultRemote(fClient, SessionFactory.createExecuteSession(), transfer, sql, objectId,
fetchSize, true, readModel, false, null);
isQuery = result.isQuery();
if (!isQuery() && result.getRowCount() > 0) {
throw JdbcException.get(SQLErrorCode.METHOD_ONLY_ALLOWED_FOR_QUERY,
"sql:" + sql);
}
} catch (IOException e) {
session.removeServer(e);