if (log.isTraceEnabled()) { log.trace(sql); log.trace("Inserted " + rows + " rows"); }
if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(sql, channelID, ref.getMessageID(), ref.getStoreID(), null, "C") + " inserted " + rows + " row(s)"); }
   public void add(Serializable channelID, Delivery d) throws Exception   {      if (log.isTraceEnabled()) { log.trace("Adding delivery " + d + " to channel: "  + channelID);}      Connection conn = null;      PreparedStatement ps = null;      TransactionWrapper wrap = new TransactionWrapper();      try      {         MessageReference ref = d.getReference();         conn = ds.getConnection();                  String sql = "INSERT INTO DELIVERY (CHANNELID, MESSAGEID, STOREID, TRANSACTIONID, STATE) VALUES (?, ?, ?, ?, ?)";         ps = conn.prepareStatement(sql);         ps.setString(1, (String)channelID);         ps.setString(2, (String)ref.getMessageID());         ps.setString(3, (String)ref.getStoreID());         ps.setNull(4, java.sql.Types.VARCHAR);         ps.setString(5, "C");         int rows = ps.executeUpdate();         if (log.isTraceEnabled())         {            log.trace(sql);            log.trace("Inserted " + rows + " rows");         }               }      catch (SQLException e)      {         wrap.exceptionOccurred();         throw e;      }      finally      {         if (ps != null)         {            try            {               ps.close();            }            catch (Throwable t)            {}         }         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable t)            {}         }         wrap.end();      }   }