1 | package com.alwyn.redis.test; |
测试1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20package com.alwyn.redis.test;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
public class JedisPoolDemo {
public static void main(String[] args) {
JedisPool jedisPool = RedisPoolUtils.getInstance();
Jedis jedis = null;
try
{
jedis = jedisPool.getResource();
jedis.set("k18","v183");
} catch (Exception e) {
e.printStackTrace();
}finally{
RedisPoolUtils.release(jedisPool, jedis);
}
}
}