redis整合springboot
2021-03-13 01:31
标签:default tco def spring utils pen tor disco etc redis参照processon图,包含redis知识库。 依赖中配置 public String getDBStr(int db, String key) { public void setDBStr(int db, String key, String value) { redis整合springboot 标签:default tco def spring utils pen tor disco etc 原文地址:https://www.cnblogs.com/stubborn-dude/p/13959849.html
https://www.processon.com/mindmap/5fab94d77d9c0865e9bc7838
spring-boot-starter-data-redis
RedisConnectionFactory connectionFactory = redisTemplate.getConnectionFactory();
RedisConnection redisConnection = RedisConnectionUtils.bindConnection(connectionFactory);
DefaultStringRedisConnection stringRedisConnection = new DefaultStringRedisConnection(redisConnection);
stringRedisConnection.select(db);
return stringRedisConnection.get(key);
}
RedisConnectionFactory connectionFactory = redisTemplate.getConnectionFactory();
RedisConnection redisConnection = RedisConnectionUtils.bindConnection(connectionFactory);
DefaultStringRedisConnection stringRedisConnection = new DefaultStringRedisConnection(redisConnection);
stringRedisConnection.select(db);
stringRedisConnection.set(key, value);
}
上一篇:python数学函数