0
点赞
收藏
分享

微信扫一扫

java代码连接redis

alanwhy 2023-12-02 阅读 39

RedisURI uri = RedisURI.Builder.redis("XXXX", 16379)
                    .withDatabase(6)
                    .withPassword("XXXX")
                    .build();
            redisClient = RedisClient.create(uri);
            connect= redisClient.connect();
            RedisCommands syncCommands = connect.sync();
            Object count = syncCommands.get("count");

 



举报

相关推荐

0 条评论