Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT obj_Id FROM characters WHERE char_name=? LIMIT 1");
      statement.setString(1, name);
      rset = statement.executeQuery();
      if(rset.next())
      {
        res = rset.getInt("obj_Id");
View Full Code Here


    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT char_name FROM characters WHERE obj_Id=? LIMIT 1");
      statement.setInt(1, id);
      rset = statement.executeQuery();
      if(rset.next())
      {
        name = rset.getString("char_name");
View Full Code Here

    FiltredPreparedStatement st = null;
    ResultSet rs = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      st = con.prepareStatement("SELECT char_name FROM characters WHERE char_name LIKE ?");
      st.setString(1, name);
      rs = st.executeQuery();
      return !rs.next();
    }
    catch(Exception e)
View Full Code Here

    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

      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

      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

      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

    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

    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

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO epic_boss_spawn (bossId,respawnDate,state) VALUES(?,?,?)");
      statement.setInt(1, _bossId);
      statement.setInt(2, (int) (_respawnDate / 1000));
      statement.setInt(3, _state.ordinal());
      statement.execute();
      statement.close();
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.