redis切换数据库的方法【jedis】

redis切换数据库的方法【jedis】

2017年07月08日 15:14:13

阅读数:24600

 
  1. package com.test;

  2.  
  3. import redis.clients.jedis.Jedis;

  4.  
  5. public class readredis {

  6. public static void main(String[] args) {

  7. // 连接本地的 Redis 服务

  8. Jedis jedis = new Jedis("127.0.0.1", 6379);

  9. jedis.select(10);

  10. String value = jedis.hget("place:01", "placename");

  11. System.out.println(value);

  12. }

  13.  

猜你喜欢

转载自blog.csdn.net/f45056231p/article/details/81608564