Jedis之Redis各种类型操作

Jedis之Redis各种类型操作

说明:该文采用Java使用Jedis操作Redis的各种类型的操作,包括 String、list、map、set、sorted set以及事务。
有关Redis的命令请参考我的另一篇博文《Redis命令大全》
https://blog.csdn.net/hcyxsh/article/details/114028122

一 Jar包准备

项目中加入jar:
(1)jedis-2.9.0.jar
(2)commons-pool2-2.4.2.jar

二 各种类型操作实现

(1)字符串(string)

在这里插入图片描述
(2)哈希(hash)
① 使用Jedis连接池
在这里插入图片描述
② 使用连接池操作hash数据类型
在这里插入图片描述
(3)列表(list)
在这里插入图片描述
(4)集合(set)
在这里插入图片描述
(5)有序集合(sorted set)
在这里插入图片描述
(6)事务(Transaction)

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/hcyxsh/article/details/114599293
今日推荐