Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM residence_functions WHERE id=? AND type=?");
      statement.setInt(1, getId());
      statement.setInt(2, type);
      statement.execute();
    }
    catch(Exception e)
View Full Code Here


    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      if(_enchantAttributeElement != L2Item.ATTRIBUTE_NONE)
      {
        statement = con.prepareStatement("UPDATE item_attributes SET augAttributes = -1, augSkillId = -1, augSkillLevel = -1 WHERE itemId = ? LIMIT 1");
      }
      else
      {
        statement = con.prepareStatement("DELETE FROM item_attributes WHERE itemId = ? LIMIT 1");
      }
View Full Code Here

      {
        statement = con.prepareStatement("UPDATE item_attributes SET augAttributes = -1, augSkillId = -1, augSkillLevel = -1 WHERE itemId = ? LIMIT 1");
      }
      else
      {
        statement = con.prepareStatement("DELETE FROM item_attributes WHERE itemId = ? LIMIT 1");
      }
      statement.setInt(1, getObjectId());
      statement.executeUpdate();
    }
    catch(Exception e)
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM item_attributes WHERE itemId = ?");
      statement.setInt(1, getObjectId());
      statement.executeUpdate();
    }
    catch(Exception e)
    {
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT augAttributes,augSkillId,augSkillLevel,elemType,elemValue FROM item_attributes WHERE itemId=? LIMIT 1");
      statement.setInt(1, getObjectId());
      ResultSet rs;
      rs = statement.executeQuery();
      if(rs.next())
      {
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO item_attributes VALUES(?,?,?,?,?,?)");
      statement.setInt(1, getObjectId());
      if(_augmentation == null)
      {
        statement.setInt(2, -1);
        statement.setInt(3, -1);
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet item_rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM items WHERE object_id=? LIMIT 1");
      statement.setLong(1, objectId);
      item_rset = statement.executeQuery();
      if(item_rset.next())
      {
        inst = restoreFromDb(item_rset, con, putInStorage);
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE items SET owner_id=?,count=?,loc=?,loc_data=?,enchant_level=?,shadow_life_time=?,item_id=?,flags=? WHERE object_id = ? LIMIT 1");
      statement.setInt(1, getOwnerId());
      statement.setLong(2, _count);
      statement.setString(3, _loc.name());
      statement.setInt(4, _loc_data);
      statement.setInt(5, getEnchantLevel());
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO items (owner_id,item_id,count,loc,loc_data,enchant_level,object_id,custom_type1,custom_type2,shadow_life_time,name,class,flags) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)");
      statement.setInt(1, getOwnerId());
      statement.setInt(2, _itemId);
      statement.setLong(3, _count);
      statement.setString(4, _loc.name());
      statement.setInt(5, _loc_data);
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM items WHERE object_id = ? LIMIT 1");
      statement.setInt(1, _objectId);
      statement.executeUpdate();
      _existsInDb = false;
      _storedInDb = false;
      Stat.increaseDeleteItemCount();
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.