public void handleCommandStatus(String status, int updateCount, long insertOID) { append(new ResultWrapper(updateCount, insertOID)); }
private void append(ResultWrapper newResult) { if (results == null) results = newResult; else results.append(newResult); }
public long getLastOID() throws SQLException { checkClosed(); if (result == null) return 0; return result.getInsertOID(); }
public boolean getMoreResults() throws SQLException { if (result == null) return false; result = result.getNext(); // Close preceding resultsets. while (firstUnclosedResult != result) { if (firstUnclosedResult.getResultSet() != null) firstUnclosedResult.getResultSet().close(); firstUnclosedResult = firstUnclosedResult.getNext(); } return (result != null && result.getResultSet() != null); }
public int getUpdateCount() throws SQLException { checkClosed(); if (result == null || result.getResultSet() != null) return -1; return result.getUpdateCount(); }
public java.sql.ResultSet getResultSet() throws SQLException { checkClosed(); if (result == null) return null; return (ResultSet) result.getResultSet(); }
result = result.getNext();
if (current == Statement.CLOSE_CURRENT_RESULT && result != null && result.getResultSet() != null) result.getResultSet().close(); result = result.getNext(); if (firstUnclosedResult.getResultSet() != null) firstUnclosedResult.getResultSet().close(); firstUnclosedResult = firstUnclosedResult.getNext(); return (result != null && result.getResultSet() != null);
/** * Retrieves any auto-generated keys created as a result of executing this * <code>Statement</code> object. If this <code>Statement</code> object did * not generate any keys, an empty <code>ResultSet</code> * object is returned. * * @return a <code>ResultSet</code> object containing the auto-generated key(s) * generated by the execution of this <code>Statement</code> object * @exception SQLException if a database access error occurs * @since 1.4 */ public ResultSet getGeneratedKeys() throws SQLException { checkClosed(); if (generatedKeys == null || generatedKeys.getResultSet() == null) return createDriverResultSet(new Field[0], new Vector()); return generatedKeys.getResultSet(); }
public int getUpdateCount() throws SQLException { checkClosed(); if (result == null || result.getResultSet() != null) return -1; return result.getUpdateCount(); }
result = result.getNext();
protected void closeForNextExecution() throws SQLException { // Every statement execution clears any previous warnings. clearWarnings(); // Close any existing resultsets associated with this statement. while (firstUnclosedResult != null) { if (firstUnclosedResult.getResultSet() != null) firstUnclosedResult.getResultSet().close(); firstUnclosedResult = firstUnclosedResult.getNext(); } result = null; if (lastSimpleQuery != null) { lastSimpleQuery.close(); lastSimpleQuery = null; } if (generatedKeys != null) { if (generatedKeys.getResultSet() != null) { generatedKeys.getResultSet().close(); } generatedKeys = null; } }
if (result == null || result.getResultSet() == null) throw new PSQLException(GT.tr("A CallableStatement was executed with nothing returned."), PSQLState.NO_DATA); ResultSet rs = result.getResultSet(); if (!rs.next()) throw new PSQLException(GT.tr("A CallableStatement was executed with nothing returned."), PSQLState.NO_DATA); return (result != null && result.getResultSet() != null);
public int getUpdateCount() throws SQLException { checkClosed(); if (result == null || result.getResultSet() != null) return -1; return result.getUpdateCount(); }
public void handleResultRows(Query fromQuery, Field[] fields, Vector tuples, ResultCursor cursor) { try { ResultSet rs = AbstractJdbc2Statement.this.createResultSet(fromQuery, fields, tuples, cursor); append(new ResultWrapper(rs)); } catch (SQLException e) { handleError(e); } }
public int getInsertedOID() throws SQLException { checkClosed(); if (result == null) return 0; return (int) result.getInsertOID(); }
private void append(ResultWrapper newResult) { if (results == null) results = newResult; else results.append(newResult); }
public java.sql.ResultSet executeQuery() throws SQLException { if (!executeWithFlags(0)) throw new PSQLException(GT.tr("No results were returned by the query."), PSQLState.NO_DATA); if (result.getNext() != null) throw new PSQLException(GT.tr("Multiple ResultSets were returned by the query."), PSQLState.TOO_MANY_RESULTS); return (ResultSet) result.getResultSet(); }
public boolean executeWithFlags(String p_sql, int flags) throws SQLException { checkClosed(); p_sql = replaceProcessing(p_sql); Query simpleQuery = connection.getQueryExecutor().createSimpleQuery(p_sql); execute(simpleQuery, null, QueryExecutor.QUERY_ONESHOT | flags); this.lastSimpleQuery = simpleQuery; return (result != null && result.getResultSet() != null); }
generatedKeys = new ResultWrapper(((BatchResultHandler)handler).getGeneratedKeys());