Examples of ThreadConnection


Examples of l2p.database.ThreadConnection

  }

  public static String getPlayerNameByObjId(int oid)
  {
    String pName = null;
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT `char_name` FROM `characters` WHERE `obj_Id`=\"" + oid + "\" LIMIT 1");
      rset = statement.executeQuery();
      if(rset.next())
      {
        pName = rset.getString(1);
      }
View Full Code Here

Examples of l2p.database.ThreadConnection

      }
      _logChat.log(record);
    }
    if(Config.LOG_CHAT_DB != null && !Config.LOG_CHAT_DB.isEmpty())
    {
      ThreadConnection con = null;
      FiltredPreparedStatement statement = null;
      try
      {
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("INSERT DELAYED INTO " + Config.LOG_CHAT_DB + " (`type`,`text`,`from`,`to`) VALUES(?,?,?,?);");
        statement.setString(1, type.trim());
        statement.setString(2, text);
        statement.setString(3, from);
        statement.setString(4, to != null ? to : "");
        statement.execute();
View Full Code Here

Examples of l2p.database.ThreadConnection

  public static void SqlLog(L2Character activeObject, L2Character target, Integer log_id, L2ItemInstance Item, String etc_str1, String etc_str2, String etc_str3, Integer etc_num1, Integer etc_num2, Integer etc_num3, Integer etc_num4, Integer etc_num5, Integer etc_num6, Integer etc_num7, Integer etc_num8, Long etc_num9, Long etc_num10)
  {
    if(Config.SQL_LOG)
    {
      ThreadConnection con = null;
      FiltredPreparedStatement statement = null;
      try
      {
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("INSERT INTO game_log (serv_id, act_time, log_id, actor, actor_type, target, target_type, location_x, location_y, location_z, etc_str1, etc_str2, etc_str3, etc_num1, etc_num2, etc_num3, etc_num4, etc_num5, etc_num6, etc_num7, etc_num8, etc_num9, etc_num10, STR_actor, STR_actor_account, STR_target, STR_target_account, item_id) " + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);");
        statement.setInt(1, 0); //serv_id
        statement.setLong(2, System.currentTimeMillis() / 1000); //act_time
        statement.setInt(3, log_id); //log_id
        if(activeObject != null)
        {
View Full Code Here

Examples of l2p.database.ThreadConnection

  public static void LogPetition(L2Player fromChar, Integer Petition_type, String Petition_text)
  {
    if(Config.SQL_LOG)
    {
      ThreadConnection con = null;
      FiltredPreparedStatement statement = null;
      try
      {
        con = L2DatabaseFactory.getInstance().getConnection();
        statement = con.prepareStatement("INSERT INTO petitions (serv_id, act_time, petition_type, actor, location_x, location_y, location_z, petition_text, STR_actor, STR_actor_account) VALUES (?,?,?,?,?,?,?,?,?,?);");
        statement.setInt(1, 0); //serv_id
        statement.setLong(2, System.currentTimeMillis() / 1000); //act_time
        statement.setInt(3, Petition_type); //log_id
        statement.setInt(4, fromChar.getObjectId());
        statement.setInt(5, fromChar.getX()); //location_x,
View Full Code Here

Examples of l2p.database.ThreadConnection

  {
    if(!Config.SQL_LOG)
    {
      return;
    }
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("INSERT INTO loginserv_log (act_time, log_id, etc_str1, etc_str2, etc_str3, etc_num1, etc_num2) " + "VALUES (?,?,?,?,?,?,?);");
      statement.setLong(1, System.currentTimeMillis() / 1000); //act_time
      statement.setInt(2, log_id); //log_id
      statement.setString(3, etc_str1); //etc_str1,
      statement.setString(4, etc_str2); //etc_str2
      statement.setString(5, etc_str3); //etc_str3,
View Full Code Here

Examples of l2p.database.ThreadConnection

    }
  }

  public void load()
  {
    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM epic_boss_spawn WHERE bossId = ? LIMIT 1");
      statement.setInt(1, _bossId);
      rset = statement.executeQuery();
      if(rset.next())
      {
        _respawnDate = rset.getLong("respawnDate") * 1000L;
 
View Full Code Here

Examples of org.apache.olio.workload.loader.framework.ThreadConnection

        ifields[0] = r.random(1, ScaleFactors.users); // addressId
        // The rest is initialized to 0 anyway, leave it that way.
    }
   
     public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            PreparedStatement s = c.prepareStatement(STATEMENT);
            for (int i = 0; i < fields.length; i++)
                if (fields[i] != null)
                    s.setString(i + 1, fields[i]);
                else
                    s.setNull(i + 1, Types.VARCHAR);
            s.setDate(10, createdTimestamp);
            for (int i = 0; i < ifields.length; i++)
                s.setInt(11 + i, ifields[i]);
            c.addBatch();
        } catch (SQLException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.apache.olio.workload.loader.framework.ThreadConnection

     /**
     * For tags, we won't know the refcount till all the data is loaded.
     * So we update the table at postload.
     */
    public void postLoad() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            //update id
             logger.fine("before updating socialEventID");            
            
             c.prepareStatement("INSERT INTO ID_GEN " +
                    "(GEN_KEY, GEN_VALUE) " +
                    "VALUES ('SOCIAL_EVENT_ID', "+ ScaleFactors.events +1 + ")");
             c.executeUpdate();                         
            
            /*
             c.prepareStatement("update ID_GEN set GEN_VALUE = " +
                    "(select count(*) +1 from SOCIALEVENT) " +
                    "where GEN_KEY='SOCIAL_EVENT_ID'");
View Full Code Here

Examples of org.apache.olio.workload.loader.framework.ThreadConnection

        //for (int friendId : friendSet)
         //   friends[idx++] = UserName.getUserName(friendId);
    }

    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
        //    for (String friend : friends) {
        for (Integer friend : friendSet) {
                PreparedStatement s = c.prepareStatement(STATEMENT);
                //s.setString(1, userName);
                //s.setString(2, friend);
        s.setInt(1, id);
        s.setInt(2, friend);
                c.addBatch();
            }
        } catch (SQLException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
            //LoadController.increaseErrorCount();
        }
View Full Code Here

Examples of org.apache.olio.workload.loader.framework.ThreadConnection

        tag = UserName.getUserName(id);
    }


    public void load() {
        ThreadConnection c = ThreadConnection.getInstance();
        try {
            PreparedStatement s = c.prepareStatement(STATEMENT);
            s.setString(1, tag);
            s.setInt(2, 0); // Initialize it to 0 first, count and add later.
            c.addBatch();
        } catch (SQLException e) {
            logger.log(Level.SEVERE, e.getMessage(), e);
            Loader.increaseErrorCount();
        }
    }
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.