REDIS实验

package redisshiyan;

import java.util.Map;
import redis.clients.jedis.Jedis;
public class hadoopshiyansan1 {
   public static void main(String[] args) {
       Jedis jedis = new Jedis("192.168.198.130", 6379);
       jedis.hset("student.scofield", "English", "45");
       jedis.hset("student.scofield", "Math", "89");
       jedis.hset("student.scofield", "Computer", "100");
       Map<String, String> value = jedis.hgetAll("student.scofield");
       for (Map.Entry<String, String> entry : value.entrySet()) {
           System.out.println(entry.getKey() + ":" + entry.getValue());
       }
   }
}

redis的一个代码的测试

posted @ 2020-11-27 22:17  凋零_(  阅读(75)  评论(0编辑  收藏  举报