基于Java的 Redis客户端
set hello world
jedis.set("hello","world")
jedis.get("hello")
其他操作类似
Jedis操作
1.生成Jedis对象
Jedis jedis = new Jedis("127.0.0.1",6379);
2.Jedis执行set操作
3.Jedis执行get操作
Jedis 连接池
Jedis 直连
- 生成Jedis对象
- Jedis执行命令
- 返回执行结果
- 关闭Jedis连接
Jedis 连接池
- 从JedisPool借用Jedis对象
- Jedis执行命令
- 返回执行结果
- 会还Jedis对象给连接池
![UA]P{~AN{MR9(AZFDD}9FRQ.png](https://upload-images.jianshu.io/upload_images/7228528-5701198db3045908.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)