private boolean executeInternal(String sql) throws SQLException {
checkClosedForWrite();
try {
closeOldResultSet();
CommandInterface command = conn.prepareCommand(sql, fetchSize, session);
boolean returnsResultSet;
synchronized (session) {
setExecutingStatement(command);
try {
if (command.isQuery()) {
returnsResultSet = true;
ResultInterface result = command.executeQuery(maxRows);
resultSet = new JdbcResultSet(conn, this, result, closedByResultSet);
} else {
returnsResultSet = false;
updateCount = command.executeUpdate();
}
} finally {
setExecutingStatement(null);
}
}
command.close();
return returnsResultSet;
} finally {
afterWriting();
}
}