Package marauroa.server.db

Examples of marauroa.server.db.DBTransaction.execute()


  }

  private void cleanDB() throws SQLException {
    final DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      transaction.execute("DELETE FROM character_stats where name='player';", null);
      transaction.execute("DELETE FROM rpobject WHERE object_id IN (SELECT object_id FROM characters WHERE characters.charname = 'player');", null);
      transaction.execute("DELETE FROM characters WHERE characters.charname = 'player';", null);
      TransactionPool.get().commit(transaction);
    } catch (final SQLException e) {
      TransactionPool.get().rollback(transaction);
View Full Code Here


  private void cleanDB() throws SQLException {
    final DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      transaction.execute("DELETE FROM character_stats where name='player';", null);
      transaction.execute("DELETE FROM rpobject WHERE object_id IN (SELECT object_id FROM characters WHERE characters.charname = 'player');", null);
      transaction.execute("DELETE FROM characters WHERE characters.charname = 'player';", null);
      TransactionPool.get().commit(transaction);
    } catch (final SQLException e) {
      TransactionPool.get().rollback(transaction);
      throw e;
View Full Code Here

  private void cleanDB() throws SQLException {
    final DBTransaction transaction = TransactionPool.get().beginWork();
    try {
      transaction.execute("DELETE FROM character_stats where name='player';", null);
      transaction.execute("DELETE FROM rpobject WHERE object_id IN (SELECT object_id FROM characters WHERE characters.charname = 'player');", null);
      transaction.execute("DELETE FROM characters WHERE characters.charname = 'player';", null);
      TransactionPool.get().commit(transaction);
    } catch (final SQLException e) {
      TransactionPool.get().rollback(transaction);
      throw e;
    }
View Full Code Here

      params.put("quantity", itemInfo.getQuantity());
      params.put("giver", oldItemInfo.getOwner());
      params.put("receiver", itemInfo.getOwner());
      params.put("oldid", entry.getId());
     
      transaction.execute(query, params);
      //System.out.println(itemInfo + " " + oldItemInfo.getOwner() + " " + itemInfo.getOwner());

      TransactionPool.get().commit(transaction);
    } catch (Exception e) {
      TransactionPool.get().rollback(transaction);
View Full Code Here

    for (int i = 1122; i < 346000; i++) {
      System.out.println("> " + i);
      String cmd = "INSERT INTO itemlog_new (id, timedate, itemid, source, event, param1, param2, param3, param4)"
        + " SELECT id, timedate, itemid, source, event, param1, param2, param3, param4 FROM itemlog WHERE id >= " + (i * 100) + " AND id < "  + ((i+1) * 100);
      DBTransaction transaction = transactionPool.beginWork();
      transaction.execute(cmd, null);
      transactionPool.commit(transaction);
      System.out.println("< " + i);
      Thread.sleep(3000);
    }
  }
View Full Code Here

     
      if (cmd.indexOf(";") > -1) {
        DBTransaction transaction = transactionPool.beginWork();
        try {
          if (cmd.indexOf("DROP TABLE") != 0 && cmd.indexOf("CREATE TABLE") != 0) {
            transaction.execute(line, null);
          }
        } catch (SQLException e) {
          logger.error(cmd, e);
        }
        transactionPool.commit(transaction);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.