{ m = (Message)rs.getObject("PAYLOAD"); referenceCount = rs.getInt("REFERENCECOUNT"); count ++;
{ m = MessageFactory.createMessage(rs.getString(1), rs.getString(2).equals("Y"), rs.getLong(3), rs.getLong(4), rs.getInt(5), rs.getInt(6), (Map)rs.getObject(7), (Serializable)rs.getObject(8), rs.getInt(9), rs.getString(10), rs.getObject(11), rs.getString(12).equals("Y"), rs.getString(13), rs.getString(14).equals("Y"), rs.getString(15), rs.getString(16), (Map)rs.getObject(17));  referenceCount = rs.getInt(18); count ++;
   public Message retrieveMessage(Serializable messageID)         throws Exception   {      Connection conn = null;      PreparedStatement ps = null;      ResultSet rs = null;      TransactionWrapper wrap = new TransactionWrapper();      try      {         Message m = null;         int referenceCount = 0;         conn = ds.getConnection();         ps = conn.prepareStatement(selectMessage);         ps.setString(1, (String)messageID);                  rs = ps.executeQuery();         int count = 0;         if (rs.next())         {            m = (Message)rs.getObject("PAYLOAD");            referenceCount = rs.getInt("REFERENCECOUNT");            count ++;            /*            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"));              */                                 }         if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(selectMessage, messageID) + " selected " + count + " row(s)"); }         if (m != null)         {            // increment the reference count            ps = conn.prepareStatement(updateReferenceCount);            ps.setInt(1, ++referenceCount);            ps.setString(2, (String)m.getMessageID());            ps.executeUpdate();            if (log.isTraceEnabled()) { log.trace(JDBCUtil.statementToString(updateReferenceCount, new Integer(referenceCount), m.getMessageID()) + " executed successfully"); }         }         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();      }   }