@Override protected ResultSet runQuery(Connection connection) throws SQLException { statement = getStatement(connection, sql); if (getMaxRows() != 0) statement.setMaxRows(getMaxRows()); return statement.executeQuery(sql); } }
/** * Factory for the QueryCommand command pattern object allows subclasses to * supply implementations of the command class. The factory will be used in a pattern * similar to: * <pre> * AbstractQueryCommand q = createQueryCommand("update TABLE set count = 0) where count is null"); * try { * ResultSet rs = q.execute(); * return asList(rs); * } finally { * q.closeResources(); * } * </pre> * * @param sql statement to be executed * @return a command - invoke its execute() and closeResource() methods */ protected AbstractQueryCommand createQueryCommand(String sql) { return new QueryCommand(sql); }
/** * Factory for the QueryCommand command pattern object allows subclasses to * supply implementations of the command class. The factory will be used in a pattern * similar to: * <pre> * AbstractQueryCommand q = createQueryCommand("update TABLE set count = 0) where count is null"); * try { * ResultSet rs = q.execute(); * return asList(rs); * } finally { * q.closeResources(); * } * </pre> * * @param sql statement to be executed * @return a command - invoke its execute() and closeResource() methods */ protected AbstractQueryCommand createQueryCommand(String sql) { return new QueryCommand(sql); }
/** * Factory for the QueryCommand command pattern object allows subclasses to * supply implementations of the command class. The factory will be used in a pattern * similar to * <pre> * AbstractQueryCommand q = createQueryCommand("update TABLE set count = 0) where count is null"); * try { * ResultSet rs = q.execute(); * return asList(rs); * } finally { * q.closeResources(); * } * </pre> * @param sql statement to be executed * @return a command - invoke its execute() and closeResource() methods */ protected AbstractQueryCommand createQueryCommand(String sql) { return new QueryCommand(sql); }
@Override protected ResultSet runQuery(Connection connection) throws SQLException { statement = getStatement(connection, sql); if (getMaxRows() != 0) statement.setMaxRows(getMaxRows()); return statement.executeQuery(sql); } }
/** * Factory for the QueryCommand command pattern object allows subclasses to * supply implementations of the command class. The factory will be used in a pattern * similar to: * <pre> * AbstractQueryCommand q = createQueryCommand("update TABLE set count = 0) where count is null"); * try { * ResultSet rs = q.execute(); * return asList(rs); * } finally { * q.closeResources(); * } * </pre> * * @param sql statement to be executed * @return a command - invoke its execute() and closeResource() methods */ protected AbstractQueryCommand createQueryCommand(String sql) { return new QueryCommand(sql); }