Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO character_shortcuts SET char_obj_id=?,slot=?,page=?,type=?,shortcut_id=?,level=?,class_index=?");
      statement.setInt(1, player.getObjectId());
      statement.setInt(2, shortcut.slot);
      statement.setInt(3, shortcut.page);
      statement.setInt(4, shortcut.type);
      statement.setInt(5, shortcut.id);
View Full Code Here


    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM character_shortcuts WHERE char_obj_id=? AND slot=? AND page=? AND class_index=?");
      statement.setInt(1, player.getObjectId());
      statement.setInt(2, shortcut.slot);
      statement.setInt(3, shortcut.page);
      statement.setInt(4, player.getActiveClassId());
      statement.execute();
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT char_obj_id, slot, page, type, shortcut_id, level FROM character_shortcuts WHERE char_obj_id=? AND class_index=?");
      statement.setInt(1, player.getObjectId());
      statement.setInt(2, player.getActiveClassId());
      rset = statement.executeQuery();
      while(rset.next())
      {
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT id FROM siege_door WHERE unitId = ?");
      statement.setInt(1, getId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        id = rset.getInt("id");
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM siege_doorupgrade WHERE doorId IN (SELECT id FROM siege_door WHERE unitId = ?)");
      statement.setInt(1, getId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        upgradeDoor(rset.getInt("doorId"), rset.getInt("hp"), false);
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("DELETE FROM siege_doorupgrade WHERE doorId IN (SELECT id FROM siege_door WHERE unitId=?)");
      statement.setInt(1, getId());
      statement.execute();
    }
    catch(Exception e)
    {
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO siege_doorupgrade (doorId, hp) VALUES (?,?)");
      statement.setInt(1, doorId);
      statement.setInt(2, hp);
      statement.execute();
    }
    catch(Exception e)
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rs = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT * FROM residence_functions WHERE id = ?");
      statement.setInt(1, getId());
      rs = statement.executeQuery();
      while(rs.next())
      {
        ResidenceFunction function = getFunction(rs.getInt("type"));
View Full Code Here

        else
        {
          return false;
        }
        long time = Calendar.getInstance().getTimeInMillis() + 86400000;
        statement = con.prepareStatement("REPLACE residence_functions SET id=?, type=?, lvl=?, endTime=?");
        statement.setInt(1, getId());
        statement.setInt(2, type);
        statement.setInt(3, level);
        statement.setInt(4, (int) (time / 1000));
        statement.execute();
View Full Code Here

        }
        else
        {
          return false;
        }
        statement = con.prepareStatement("REPLACE residence_functions SET id=?, type=?, lvl=?");
        statement.setInt(1, getId());
        statement.setInt(2, type);
        statement.setInt(3, level);
        statement.execute();
        function.setLvl(level);
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.