首页 > 技术文章 > redis切换数据库的方法【jedis】

huahai 2017-07-08 15:14 原文

package com.test;

import redis.clients.jedis.Jedis;

public class readredis {
	public static void main(String[] args) {
        // 连接本地的 Redis 服务
		Jedis jedis =  new Jedis("127.0.0.1", 6379);
		jedis.select(10);
		String value = jedis.hget("place:01", "placename");
		System.out.println(value);
	}
}

推荐阅读