首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    Redis之Java客户端Jedis

    -------------------------------------" );      jedis.mset( "str1" , "v1" , "str2" , "v2" , "str3" , "v3" );      System. out .println(jedis.mget( "str1" , "str2" , "str3" ));       //list      System. out .println( "----------------------------------------" );       //jedis.lpush(" mylist ","v1","v2","v3","v4","v5");      List list = jedis.lrange( "mylist" ,0,-1);       for  (String element : list) {        System. out .println(element);      }       //set      jedis.sadd( "orders" , "jd001" );      jedis.sadd( "orders" , "jd002" );      jedis.sadd( "orders" , "jd003" );      Set set1 = jedis.smembers( "orders" );       for  ( Iterator  iterator = set1.iterator(); iterator.hasNext();) {        String string = (String) iterator.next();        System. out .println(string);      }      jedis.srem( "orders" , "jd002" );      System. out .println(jedis.smembers( "orders" ).size());       //hash      jedis.hset( "hash1" , "userName" , "lisi" );      System. out .println(jedis.hget( "hash1" , "userName" ));      Map<String,String> map =  new  HashMap<String,String>();      map.put( "telphone" , "13811814763" );      map.put( "address" , "atguigu" );      map.put( "email" , "abc@163.com" );      jedis.hmset( "hash2" ,map);      List result = jedis.hmget( "hash2" ,  "telphone" , "email" );       for  (String element : result) {        System. out .println(element);      }       // zset      jedis.zadd( "zset01" ,60d, "v1" );      jedis.zadd( "zset01" ,70d, "v2" );      jedis.zadd( "zset01" ,80d, "v3" );      jedis.zadd( "zset01" ,90d, "v4" );      Set s1 = jedis.zrange( "zset01" ,0,-1);       for  ( Iterator  iterator = s1.iterator(); iterator.hasNext();) {        String string = (String) iterator.next();        System. out .println(string);      }

    02
    领券