if (log.isTraceEnabled()) { log.trace(sql); }
int count = 0;
   public Message retrieve(Serializable messageID) throws Exception   {      Connection conn = null;      PreparedStatement ps = null;      ResultSet rs = null;      TransactionWrapper wrap = new TransactionWrapper();      try      {         Message m = null;         conn = ds.getConnection();                  String sql = "SELECT " +                      "MESSAGEID, " +                      "RELIABLE, " +                      "EXPIRATION, " +                      "TIMESTAMP, " +                      "COREHEADERS, " +                      "PAYLOAD, " +                      "TYPE, " +                      "JMSTYPE, " +                      "PRIORITY, " +                      "CORRELATIONID, " +                      "DESTINATIONISQUEUE, " +                      "DESTINATION, " +                      "REPLYTOISQUEUE, " +                      "REPLYTO, " +                      "JMSPROPERTIES " +                      "FROM MESSAGE WHERE MESSAGEID = ?";                  ps = conn.prepareStatement(sql);         ps.setString(1, (String)messageID);                  rs = ps.executeQuery();         if (log.isTraceEnabled()) { log.trace(sql); }            if (rs.next())         {            m = (Message)rs.getObject("PAYLOAD");            /*            m = Factory.createMessage(rs.getString("MESSAGEID"),                                      rs.getBoolean("RELIABLE"),                                      rs.getLong("EXPIRATION"),                                      rs.getLong("TIMESTAMP"),                                      (Map)rs.getObject("COREHEADERS"),                                      (Serializable)rs.getObject("PAYLOAD"),                                      rs.getInt("TYPE"),                                      rs.getString("JMSTYPE"),                                      rs.getInt("PRIORITY"),                                      rs.getObject("CORRELATIONID"),                                      rs.getBoolean("DESTINATIONISQUEUE"),                                      rs.getString("DESTINATION"),                                      rs.getBoolean("REPLYTOISQUEUE"),                                      rs.getString("REPLYTO"),                                      (Map)rs.getObject("JMSPROPERTIES"));              */                                 }                  return m;      }      catch (SQLException 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();      }       }