public final boolean getMoreResults(int current) throws SQLException { switch (current) { case CLOSE_ALL_RESULTS: // currently there exists only one ResultSet case CLOSE_CURRENT_RESULT: ResultSet rs = cmd.getResultSet(); cmd.rs = null; if (rs != null) rs.close(); break; case KEEP_CURRENT_RESULT: break; default: throw SmallSQLException.create(Language.FLAGVALUE_INVALID, String.valueOf(current)); } return cmd.getMoreResults(); }
private final void executeImpl(String sql) throws SQLException { checkStatement(); generatedKeys = null; try { con.log.println(sql); SQLParser parser = new SQLParser(); cmd = parser.parse(con, sql); if (maxRows != 0 && (cmd.getMaxRows() == -1 || cmd.getMaxRows() > maxRows)) cmd.setMaxRows(maxRows); cmd.execute(con, this); } catch (Exception e) { throw SmallSQLException.createFromException(e); } needGeneratedKeys = false; generatedKeyIndexes = null; generatedKeyNames = null; }
public final boolean execute(String sql) throws SQLException { executeImpl(sql); return cmd.getResultSet() != null; }
public final int executeUpdate(String sql) throws SQLException { executeImpl(sql); return cmd.getUpdateCount(); }
public final ResultSet executeQuery(String sql) throws SQLException { executeImpl(sql); return cmd.getQueryResult(); }
public final int getUpdateCount() throws SQLException { checkStatement(); return cmd.getUpdateCount(); }
public final ResultSet getResultSet() throws SQLException { checkStatement(); return cmd.getResultSet(); }