ps.setNull(13, Types.BIGINT);
ps.setNull(14, Types.BIGINT);
   protected void storeMessage(Message m, PreparedStatement ps) throws Exception   {      /*              Reference counting code commented out until 1.2              // get the reference count from the database       // TODO Probably this can be done smarter than that incrementing directly in the database       ps = conn.prepareStatement(selectReferenceCount);       ps.setString(1, id);              int referenceCount = 0;       ResultSet rs = ps.executeQuery();       if (rs.next())       {       referenceCount = rs.getInt(1);       }              if (trace) { log.trace(JDBCUtil.statementToString(selectReferenceCount, id) + " returned " + (referenceCount == 0 ? "no rows" : Integer.toString(referenceCount))); }              if (referenceCount == 0)       {              */            // physically insert the row in the database      //First set the fields from org.jboss.messaging.core.Routable      ps.setLong(1, m.getMessageID());      ps.setString(2, m.isReliable() ? "Y" : "N");      ps.setLong(3, m.getExpiration());      ps.setLong(4, m.getTimestamp());      ps.setByte(5, m.getPriority());      byte[] bytes = mapToBytes(((MessageSupport) m).getHeaders());      if (bytes != null)      {         setLongVarBinary(ps, 6, bytes);      }      else      {         ps.setNull(6, Types.LONGVARBINARY);      }      //Now set the fields from org.jboss.messaging.core.Message      byte[] payload = m.getPayloadAsByteArray();      if (payload != null)      {         setLongVarBinary(ps, 7, payload);      }      else      {         ps.setNull(7, Types.LONGVARBINARY);      }      //Now set the fields from org.joss.jms.message.JBossMessage if appropriate      //FIXME - We are mixing concerns here      //The basic JDBCPersistencManager should *only* know about core messages - not       //JBossMessages - we should subclass JBDCPersistenceManager and the JBossMessage      //specific code in a subclass      if (m instanceof JBossMessage)      {         JBossMessage jbm = (JBossMessage) m;         ps.setByte(8, jbm.getType());         ps.setString(9, jbm.getJMSType());         ps.setString(10, jbm.getJMSCorrelationID());         ps.setBytes(11, jbm.getJMSCorrelationIDAsBytes());         JBossDestination jbd = (JBossDestination) jbm.getJMSDestination();         CoreDestination dest = cm.getCoreDestination(jbd);         long destId = dest.getId();         ps.setLong(12, destId);         JBossDestination replyTo = (JBossDestination) jbm.getJMSReplyTo();         if (replyTo == null)         {            ps.setNull(13, Types.BIGINT);         }         else         {            long replyToId = cm.getCoreDestination(replyTo).getId();            ps.setLong(13, replyToId);         }         bytes = mapToBytes(jbm.getJMSProperties());         if (bytes != null)         {            setLongVarBinary(ps, 14, bytes);         }         else         {            ps.setNull(14, Types.LONGVARBINARY);         }      }      ps.setInt(15, 1);   }