Package l2p.database

Examples of l2p.database.FiltredPreparedStatement.executeQuery()


    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT MAX(endban) AS endban FROM bans WHERE obj_Id=? AND endban IS NOT NULL");
      statement.setInt(1, ObjectId);
      rset = statement.executeQuery();
      if(rset.next())
      {
        Long endban = rset.getLong("endban") * 1000L;
        res = endban > System.currentTimeMillis();
      }
View Full Code Here


    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

    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

    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)
    {
      e.printStackTrace();
View Full Code Here

    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

    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;
        if(_respawnDate - System.currentTimeMillis() <= 0)
        {
View Full Code Here

    {
      con = L2DatabaseFactory.getInstance().getConnection();
      offline = con.prepareStatement("SELECT bonus_expire_time FROM bonus WHERE obj_id LIKE ? AND bonus_name = ?");
      offline.setInt(1, player.getObjectId());
      offline.setString(2, type);
      rs = offline.executeQuery();
      if(rs.next())
      {
        end_.setTimeInMillis(rs.getLong(1) * 1000L);
        show(new CustomMessage("scripts.services.Bonus.bonus.alreadychar", player).addString(String.valueOf(end_.get(Calendar.DAY_OF_MONTH)) + "." + String.valueOf(end_.get(Calendar.MONTH) + 1) + "." + String.valueOf(end_.get(Calendar.YEAR))), player);
        return true;
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("SELECT friend_id FROM character_friends WHERE char_id=?");
      statement.setInt(1, ptarget.getObjectId());
      rset = statement.executeQuery();
      while(rset.next())
      {
        objectId = rset.getInt("friend_id");
        if(objectId == activeChar.getObjectId())
        {
View Full Code Here

    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      statement1 = con.prepareStatement("SELECT DISTINCT key_npc_id FROM four_sepulchers_spawnlist WHERE spawntype = ? ORDER BY key_npc_id");
      statement1.setInt(1, type);
      rset1 = statement1.executeQuery();
      while(rset1.next())
      {
        int keyNpcId = rset1.getInt("key_npc_id");
        FiltredPreparedStatement statement2 = null;
        ResultSet rset2 = null;
View Full Code Here

        try
        {
          statement2 = con.prepareStatement("SELECT id, count, npc_templateid, locx, locy, locz, heading, respawn_delay, key_npc_id FROM four_sepulchers_spawnlist WHERE key_npc_id = ? AND spawntype = ? ORDER BY id");
          statement2.setInt(1, keyNpcId);
          statement2.setInt(2, type);
          rset2 = statement2.executeQuery();
          GArray<Location> locations = new GArray<Location>();
          while(rset2.next())
          {
            locations.add(new Location(rset2.getInt("locx"), rset2.getInt("locy"), rset2.getInt("locz"), rset2.getInt("heading"), rset2.getInt("npc_templateid")));
            count++;
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.