简介
redis dao 提供简便的 redis 查询下能力, 暂时不支持写入数据.
使用说明
maven 依赖
<dependency>
<groupId>cn.linpengfei.sybnutil</groupId>
<artifactId>redis-dao</artifactId>
<version>0.3.29-SNAPSHOT</version>
</dependency>
默认 redis client 版本 3.3.0
基于 dao 查询 demo
// 使用指定的连接访问
//RedisDao dao = new RedisDao("junit", "redis://127.0.0.1:6379/9", "user", "password", DbPool.getDefaultsProperties());
// 从配置文件读取连接
RedisDao dao = new EsDaoConfImpl("test", "junit_test@junit_test_init.properties");
// 查询都有哪些 key
dao.sqlFindListMap("SELECT * FROM redis_scan where key = '*' LIMIT 10");
// 查询都有哪些 key
dao.sqlFindListMap("SELECT * FROM redis_scan_type where key = '*' LIMIT 10");
// 查询 string 值
dao.sqlFindListMap("select * from reids_string where key in (?,?,?)", 1,2,3);
// 查询 hash 值
dao.sqlFindListMap("select * from reids_hash where key in (?,?,?)", 1,2,3);