Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement(cmd);
      statement.setString(1, wordList[1]);
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      statement = con.prepareStatement("SELECT obj_id FROM characters where char_name=?");
      statement.setString(1, wordList[1]);
      rset = statement.executeQuery();
      int objId = 0;
      if(rset.next())
      {
View Full Code Here


      if(objId == 0)
      {
        return false;
      }
      // con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM character_shortcuts WHERE char_obj_id=?");
      statement.setInt(1, objId);
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      // con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE items SET loc='INVENTORY' WHERE owner_id=? AND loc!='WAREHOUSE'");
View Full Code Here

      statement = con.prepareStatement("DELETE FROM character_shortcuts WHERE char_obj_id=?");
      statement.setInt(1, objId);
      statement.execute();
      DatabaseUtils.closeStatement(statement);
      // con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("UPDATE items SET loc='INVENTORY' WHERE owner_id=? AND loc!='WAREHOUSE'");
      statement.setInt(1, objId);
      statement.execute();
    }
    catch(Exception e)
    {
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM items WHERE owner_id=? AND (loc=? OR loc=?) ORDER BY object_id DESC");
      statement.setInt(1, OWNER);
      statement.setString(2, getBaseLocation().name());
      statement.setString(3, getEquipLocation().name());
      rset = statement.executeQuery();
      L2ItemInstance item, newItem;
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO character_quests (char_id,name,var,value) VALUES (?,?,?,?)");
      statement.setInt(1, qs.getPlayer().getObjectId());
      statement.setString(2, qs.getQuest().getName());
      statement.setString(3, var);
      statement.setString(4, value);
      statement.executeUpdate();
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM character_quests WHERE char_id=? AND name=?");
      statement.setInt(1, qs.getPlayer().getObjectId());
      statement.setString(2, qs.getQuest().getName());
      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 character_quests WHERE char_id=? AND name=? AND var=?");
      statement.setInt(1, qs.getPlayer().getObjectId());
      statement.setString(2, qs.getQuest().getName());
      statement.setString(3, var);
      statement.executeUpdate();
    }
View Full Code Here

    FiltredPreparedStatement invalidQuestData = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      invalidQuestData = con.prepareStatement("DELETE FROM character_quests WHERE char_id=? and name=?");
      statement = con.prepareStatement("SELECT name,value FROM character_quests WHERE char_id=? AND var=?");
      statement.setInt(1, player.getObjectId());
      statement.setString(2, "<state>");
      rset = statement.executeQuery();
      while(rset.next())
View Full Code Here

    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      invalidQuestData = con.prepareStatement("DELETE FROM character_quests WHERE char_id=? and name=?");
      statement = con.prepareStatement("SELECT name,value FROM character_quests WHERE char_id=? AND var=?");
      statement.setInt(1, player.getObjectId());
      statement.setString(2, "<state>");
      rset = statement.executeQuery();
      while(rset.next())
      {
View Full Code Here

        new QuestState(q, player, getStateId(state));
      }
      invalidQuestData.close();
      DatabaseUtils.closeDatabaseSR(statement, rset);
      // Get list of quests owned by the player from the DB in order to add variables used in the quest.
      statement = con.prepareStatement("SELECT name,var,value FROM character_quests WHERE char_id=?");
      statement.setInt(1, player.getObjectId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        String questId = rset.getString("name");
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.