public ResultSet executeQuery(String sql) throws SQLException {
synchronized (session) {
checkClosed();
closeOldResultSet();
CommandInterface command = conn.prepareCommand(sql, fetchSize, session);
ResultInterface result = null;
setExecutingStatement(command);
try {
result = command.executeQuery(maxRows);
session.setSessionId(result.getSessionId());
} finally {
setExecutingStatement(null);
}
command.close();
resultSet = new JdbcResultSet(conn, this, result, closedByResultSet);