@Override public synchronized CommandInterface prepareCommand(String sql, int fetchSize) { return prepareLocal(sql); }
private void executeRemaining() { Command remainingCommand = session.prepareLocal(remaining); if (remainingCommand.isQuery()) { remainingCommand.query(0); } else { remainingCommand.update(); } }
@Override public QueryResult process(String query) throws ServerException { QueryResult result; Session dbSession = session.getDbSession(); Command command = null; try { synchronized (dbSession) { command = dbSession.prepareLocal(query); if (command.isQuery()) { ResultInterface resultSet = command.executeQuery(0, false); result = new QueryResult(resultSet); } else { int updateCount = command.executeUpdate(); result = new QueryResult(updateCount); } return result; } } catch (Throwable e) { throw ServerException.convert(e); } finally { if (command != null) { command.close(); } } }