Package l2p.database

Examples of l2p.database.ThreadConnection.prepareStatement()


    ThreadConnection con = null;
    FiltredPreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement(req);
      statement.setString(1, getName().equalsIgnoreCase(getTemplate().name) ? "" : getName());
      statement.setInt(2, _level);
      statement.setDouble(3, getCurrentHp());
      statement.setDouble(4, getCurrentMp());
      statement.setLong(5, _exp);
View Full Code Here


    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT (SELECT SUM(count) FROM items WHERE item_id=57) + (SELECT SUM(treasury) FROM castle) AS `count`");
      rset = statement.executeQuery();
      if(rset.next())
      {
        _adenaSum = rset.getLong("count");
      }
View Full Code Here

                    try {
                        GArray<Object> logins = mysql.get_array(L2DatabaseFactory.getInstanceLogin(),
                                "SELECT `login` FROM `accounts` WHERE `access_level` < 0");
                        if (logins.size() > 0) {
                            con = L2DatabaseFactory.getInstance().getConnection();
                            st = con.prepareStatement("DELETE FROM character_variables WHERE `name` = 'offline' AND `obj_id` IN (SELECT `obj_id` FROM `characters` WHERE `account_name`=?)");
                            for (Object login : logins) {
                                st.setString(1, (String) login);
                                st.executeUpdate();
                            }
                        }
View Full Code Here

    FiltredPreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstanceLogin().getConnection();
      statement = con.prepareStatement("SELECT * FROM `accounts` WHERE email=?");
      statement.setString(1, email1);
      rset = statement.executeQuery();
      if(rset.next())
      {
        sendMessage(new CustomMessage("scripts.services.Activation.EmailAlreadyExists", player), player);
View Full Code Here

    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement(SQL);
      fps.setInt(1, player.getObjectId());
      rs = fps.executeQuery();
      while(rs.next())
      {
        String name = rs.getString("name");
View Full Code Here

        ThreadConnection con = null;
        FiltredPreparedStatement statement = null;
        try
        {
          con = L2DatabaseFactory.getInstance().getConnection();
          statement = con.prepareStatement("UPDATE characters SET clanid = 0 WHERE clanid=?");
          statement.setInt(1, target.getClanId());
          statement.execute();
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("DELETE FROM clan_data WHERE clan_id=?");
          statement.setInt(1, target.getClanId());
View Full Code Here

          con = L2DatabaseFactory.getInstance().getConnection();
          statement = con.prepareStatement("UPDATE characters SET clanid = 0 WHERE clanid=?");
          statement.setInt(1, target.getClanId());
          statement.execute();
          DatabaseUtils.closeStatement(statement);
          statement = con.prepareStatement("DELETE FROM clan_data WHERE clan_id=?");
          statement.setInt(1, target.getClanId());
          statement.execute();
          DatabaseUtils.closeStatement(statement);
          statement = null;
          target.sendPacket(Msg.CLAN_HAS_DISPERSED);
View Full Code Here

    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement(SQL);
      fps.setInt(1, player.getObjectId());
      rs = fps.executeQuery();
      while(rs.next())
      {
        String name = rs.getString("name");
View Full Code Here

    ThreadConnection con = null;
    FiltredPreparedStatement st = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      st = con.prepareStatement("UPDATE characters SET x=?,y=?,z=? WHERE obj_Id=? LIMIT 1");
      st.setInt(1, loc.x);
      st.setInt(2, loc.y);
      st.setInt(3, loc.z);
      st.setInt(4, obj_id);
      st.executeUpdate();
View Full Code Here

    FiltredPreparedStatement fps = null;
    ResultSet rs = null;
    try
    {
      tc = L2DatabaseFactory.getInstance().getConnection();
      fps = tc.prepareStatement("SELECT obj_id, value FROM character_variables WHERE `name` = 'BlackHeart_Count' ORDER BY CAST(`value` AS DECIMAL) DESC LIMIT 15");
      rs = fps.executeQuery();
      while(rs.next())
      {
        int id = rs.getInt("obj_id");
        StatsSet hero = new StatsSet();
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.