本文共 382 字,大约阅读时间需要 1 分钟。
import redisconn = redis.Redis(host="ip", port=6379, password="passwd", db=4)conn.set("zhangsan", "123")conn.get("zhangsan")conn.close()
Jedis jedis = null;try { jedis = new Jedis("", 6379, ); jedis.auth("passwd"); jedis.select(4); jedis.get("key");} catch (Exception e) { System.out.println("error")} finally { if (jedis != null) { jedis.close(); }}
转载地址:http://rougf.baihongyu.com/