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) 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) 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); }