@Override public void fire(Connection conn,Object[] oldRow,Object[] newRow) throws SQLException {
  BigDecimal diff=null;
  if (newRow != null) {
    diff=(BigDecimal)newRow[1];
  }
  if (oldRow != null) {
    BigDecimal m=(BigDecimal)oldRow[1];
    diff=diff == null ? m.negate() : diff.subtract(m);
  }
  PreparedStatement prep=conn.prepareStatement("UPDATE INVOICE_SUM SET AMOUNT=AMOUNT+?");
  prep.setBigDecimal(1,diff);
  prep.execute();
}

@ Override public void fire ( Connection conn , Object [ ] oldRow , Object [ ] newRow ) throws SQLException { BigDecimal diff = null ; if ( newRow != null ) { diff = ( BigDecimal ) newRow [ 1 ] ; } if ( oldRow != null ) { BigDecimal m = ( BigDecimal ) oldRow [ 1 ] ; diff = diff == null ? m . negate ( ) : diff . subtract ( m ) ; } PreparedStatement prep = conn . prepareStatement ( "UPDATE INVOICE_SUM SET AMOUNT=AMOUNT+?" ) ; prep . setBigDecimal ( 1 , diff ) ; prep . execute ( ) ; }
this method is called for each triggered action .
