Jedis Redis 库选择

	Jedis jedis = new Jedis("10.110.20.152", 6379);
		
		//Select the DB with having the specified zero-based numeric index. 
		//For default every new client connection is automatically selected to DB 0.
		jedis.select(2);
		
		jedis.set("china", "中国");
		String value = jedis.get("china");

		// 打印结果:中国
		System.out.println(value);
		jedis.close();

 

 

猜你喜欢

转载自huangqiqing123.iteye.com/blog/2389311