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); }
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; } }
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 int executeUpdate() throws SQLException { if( isFunction ) { executeWithFlags(0); return 0; } executeWithFlags(QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }
public java.sql.ResultSet executeQuery(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if (!executeWithFlags(p_sql, 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 int executeUpdate(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if( isFunction ) { executeWithFlags(p_sql, 0); return 0; } executeWithFlags(p_sql, QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }
result = result.getNext();
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 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 void close() throws SQLException { // closing an already closed Statement is a no-op. if (isClosed) return ; // Force the ResultSet(s) to close while (firstUnclosedResult != null) { if (firstUnclosedResult.getResultSet() != null) firstUnclosedResult.getResultSet().close(); firstUnclosedResult = firstUnclosedResult.getNext(); } if (lastSimpleQuery != null) lastSimpleQuery.close(); if (preparedQuery != null) preparedQuery.close(); // Disasociate it from us result = firstUnclosedResult = null; isClosed = true; }
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; } }
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 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 int executeUpdate() throws SQLException { if( isFunction ) { executeWithFlags(0); return 0; } executeWithFlags(QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }
public int executeUpdate() throws SQLException { if( isFunction ) { executeWithFlags(0); return 0; } executeWithFlags(QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }
public java.sql.ResultSet executeQuery(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if (!executeWithFlags(p_sql, 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 java.sql.ResultSet executeQuery(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if (!executeWithFlags(p_sql, 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 int executeUpdate(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if( isFunction ) { executeWithFlags(p_sql, 0); return 0; } executeWithFlags(p_sql, QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }
public int executeUpdate(String p_sql) throws SQLException { if (preparedQuery != null) throw new PSQLException(GT.tr("Can''t use query methods that take a query string on a PreparedStatement."), PSQLState.WRONG_OBJECT_TYPE); if( isFunction ) { executeWithFlags(p_sql, 0); return 0; } executeWithFlags(p_sql, QueryExecutor.QUERY_NO_RESULTS); ResultWrapper iter = result; while (iter != null) { if (iter.getResultSet() != null) { throw new PSQLException(GT.tr("A result was returned when none was expected."), PSQLState.TOO_MANY_RESULTS); } iter = iter.getNext(); } return getUpdateCount(); }