您可以尝试Jedis从JedisPool. JedisConnectionException如果尚未建立连接,将抛出A :
JedisPool pool = new JedisPool(...);
try {
Jedis jedis = pool.getResource();
// Is connected
} catch (JedisConnectionException e) {
// Not connected
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9742 次 |
| 最近记录: |