ic.close();
   public void start() throws Exception   {      InitialContext ic = new InitialContext();      mgr = (TransactionManager)ic.lookup("java:/TransactionManager");            ds = (DataSource)ic.lookup("java:/DefaultDS");            Connection conn = null;            String sql = null;            TransactionWrapper tx = new TransactionWrapper();       try      {         conn = ds.getConnection();                  try         {            if (log.isTraceEnabled()) { log.trace("Creating TRANSACTION table"); }            sql = "CREATE TABLE TRANSACTION ( TRANSACTIONID INTEGER, PRIMARY KEY (TRANSACTIONID) )";            conn.createStatement().executeUpdate(sql);         }         catch (SQLException e) {         }                           try         {            if (log.isTraceEnabled()) { log.trace("Creating DELIVERY table"); }            sql = "CREATE TABLE DELIVERY (CHANNELID VARCHAR, MESSAGEID VARCHAR, STOREID VARCHAR, TRANSACTIONID VARCHAR, STATE CHAR, PRIMARY KEY(CHANNELID, MESSAGEID))";            conn.createStatement().executeUpdate(sql);         }         catch (SQLException e) {}                  try         {            if (log.isTraceEnabled()) { log.trace("Creating MESSAGE_REFERENCE table"); }            sql = "CREATE TABLE MESSAGE_REFERENCE (CHANNELID VARCHAR, MESSAGEID VARCHAR, STOREID VARCHAR, TRANSACTIONID VARCHAR, STATE CHAR, PRIMARY KEY(CHANNELID, MESSAGEID))";            conn.createStatement().executeUpdate(sql);         }         catch (SQLException e) {}         if (log.isTraceEnabled()) { log.trace("Creating MESSAGE table"); }         sql = "CREATE TABLE MESSAGE (" +            "MESSAGEID VARCHAR, " +            "RELIABLE BOOLEAN, " +            "EXPIRATION BIGINT, " +            "TIMESTAMP BIGINT, " +            "COREHEADERS OBJECT, " +            "PAYLOAD OBJECT, " +            "TYPE INT, " +            "JMSTYPE VARCHAR, " +            "PRIORITY INT, " +            "CORRELATIONID OBJECT, " +            "DESTINATIONISQUEUE BOOLEAN, " +            "DESTINATION VARCHAR, " +            "REPLYTOISQUEUE BOOLEAN, " +            "REPLYTO VARCHAR, " +            "JMSPROPERTIES OBJECT, " +            "PRIMARY KEY (MESSAGEID))";         try         {            conn.createStatement().executeUpdate(sql);                  }         catch (SQLException e) {}                  //TODO INDEXES      }      finally      {         if (conn != null)         {            try            {               conn.close();            }            catch (Throwable t)            {}         }         tx.end();      }   }