@Override public void handleError(SQLException error) { if (delegate != null) { delegate.handleError(error); } }
public void handleError(SQLException error) { sawError = true; delegateHandler.handleError(error); }
public void handleError(SQLException error) { delegateHandler.handleError(error); }
public void handleError(SQLException error) { delegateHandler.handleError(error); }
public void handleError(SQLException error) { delegateHandler.handleError(error); }
public void handleError(SQLException error) { delegateHandler.handleError(error); }
private void interpretCommandStatus(String status, ResultHandler handler) { int update_count = 0; long insert_oid = 0; if (status.startsWith("INSERT") || status.startsWith("UPDATE") || status.startsWith("DELETE") || status.startsWith("MOVE")) { try { update_count = Integer.parseInt(status.substring(1 + status.lastIndexOf(' '))); if (status.startsWith("INSERT")) insert_oid = Long.parseLong(status.substring(1 + status.indexOf(' '), status.lastIndexOf(' '))); } catch (NumberFormatException nfe) { handler.handleError(new PSQLException(GT.tr("Unable to interpret the update count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE)); return ; } } handler.handleCommandStatus(status, update_count, insert_oid); }
private void interpretCommandStatus(String status, ResultHandler handler) throws IOException { int update_count = 0; long insert_oid = 0; if (status.equals("BEGIN")) protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_OPEN); else if (status.equals("COMMIT") || status.equals("ROLLBACK")) protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_IDLE); else if (status.startsWith("INSERT") || status.startsWith("UPDATE") || status.startsWith("DELETE") || status.startsWith("MOVE")) { try { update_count = Integer.parseInt(status.substring(1 + status.lastIndexOf(' '))); if (status.startsWith("INSERT")) insert_oid = Long.parseLong(status.substring(1 + status.indexOf(' '), status.lastIndexOf(' '))); } catch (NumberFormatException nfe) { handler.handleError(new PSQLException(GT.tr("Unable to interpret the update count in command completion tag: {0}.", status), PSQLState.CONNECTION_FAILURE)); return ; } } handler.handleCommandStatus(status, update_count, insert_oid); }
private void interpretCommandStatus(String status, ResultHandler handler) { try { commandCompleteParser.parse(status); } catch (SQLException e) { handler.handleError(e); return; } long oid = commandCompleteParser.getOid(); long count = commandCompleteParser.getRows(); int countAsInt = 0; if (count > Integer.MAX_VALUE) { // If command status indicates that we've modified more than Integer.MAX_VALUE rows // then we set the result count to reflect that we cannot provide the actual number // due to the JDBC field being an int rather than a long. countAsInt = Statement.SUCCESS_NO_INFO; } else if (count > 0) { countAsInt = (int) count; } handler.handleCommandStatus(status, countAsInt, oid); }
} catch (OutOfMemoryError oome) { if (!noResults) { handler.handleError( new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome)); handler.handleError(error); if (willHealViaReparse(error)) { receiveParameterStatus(); } catch (SQLException e) { handler.handleError(e); endQuery = true; handler.handleError( new PSQLException(GT.tr("The driver currently does not support COPY operations."), PSQLState.NOT_IMPLEMENTED));
} catch(OutOfMemoryError oome) { if (maxRows == 0 || tuples.size() < maxRows) { handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome)); } catch(OutOfMemoryError oome) { if (maxRows == 0 || tuples.size() < maxRows) handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome)); handler.handleError(receiveErrorMessage());
estimatedReceiveBufferBytes = 0; handler .handleError(new PSQLException(GT.tr("Unable to bind parameter values for statement."), PSQLState.INVALID_PARAMETER_VALUE, se.getIOException())); handler.handleError( new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
} catch(OutOfMemoryError oome) { if (!noResults) { handler.handleError(new PSQLException(GT.tr("Ran out of memory retrieving query results."), PSQLState.OUT_OF_MEMORY, oome)); handler.handleError(error); handler.handleError(new PSQLException(GT.tr("The server''s client_encoding parameter was changed to {0}. The JDBC driver requires client_encoding to be UTF8 for correct operation.", value), PSQLState.CONNECTION_FAILURE)); endQuery = true; handler.handleError(new PSQLException(GT.tr("The server''s DateStyle parameter was changed to {0}. The JDBC driver requires DateStyle to begin with ISO for correct operation.", value), PSQLState.CONNECTION_FAILURE)); endQuery = true; handler.handleError(new PSQLException(GT.tr("The server''s standard_conforming_strings parameter was reported as {0}. The JDBC driver expected on or off.", value), PSQLState.CONNECTION_FAILURE)); endQuery = true; handler.handleError(new PSQLException(GT.tr("The driver currently does not support COPY operations."), PSQLState.NOT_IMPLEMENTED)); break;
handler.handleError( new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
handler.handleError(new PSQLException(GT.tr("Unable to bind parameter values for statement."), PSQLState.INVALID_PARAMETER_VALUE, se.getIOException())); handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
public synchronized void fetch(ResultCursor cursor, ResultHandler handler, int fetchSize) throws SQLException { waitOnLock(); final Portal portal = (Portal) cursor; // Insert a ResultHandler that turns bare command statuses into empty datasets // (if the fetch returns no rows, we see just a CommandStatus..) final ResultHandler delegateHandler = handler; handler = new ResultHandlerDelegate(delegateHandler) { public void handleCommandStatus(String status, int updateCount, long insertOID) { handleResultRows(portal.getQuery(), null, new ArrayList<byte[][]>(), null); } }; // Now actually run it. try { processDeadParsedQueries(); processDeadPortals(); sendExecute(portal.getQuery(), portal, fetchSize); sendSync(); processResults(handler, 0); estimatedReceiveBufferBytes = 0; } catch (IOException e) { abort(); handler.handleError( new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, e)); } handler.handleCompletion(); }
handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
handler.handleError(new PSQLException(GT.tr("An I/O error occured while sending to the backend."), PSQLState.CONNECTION_FAILURE, e));
public void handleError(SQLException error) { sawError = true; delegateHandler.handleError(error); }