if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(selectReferenceCount, messageID) + " returned " + (count == 0 ? "no rows" : Integer.toString(count))); }
if (trace) { log.trace(JDBCUtil.statementToString(selectReferenceCount, messageID) + " returned " + (count == 0 ? "no rows" : Integer.toString(count))); }
   public int getMessageReferenceCount(Serializable messageID) throws Exception   {      Connection conn = null;      PreparedStatement ps = null;      ResultSet rs = null;      TransactionWrapper wrap = new TransactionWrapper();      try      {         conn = ds.getConnection();         ps = conn.prepareStatement(selectReferenceCount);         ps.setString(1, (String)messageID);         rs = ps.executeQuery();         int count = 0;         if (rs.next())         {            count = rs.getInt(1);         }         if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(selectReferenceCount, messageID) + " returned " + (count == 0 ? "no rows" : Integer.toString(count))); }         return count;      }      catch (Exception e)      {         wrap.exceptionOccurred();         throw e;      }      finally      {         if (rs != null)         {            try            {               rs.close();            }            catch (Throwable e)            {}         }         if (ps != null)         {            try            {               ps.close();            }            catch (Throwable e)            {}         }         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable e)            {}         }         wrap.end();      }   }