hooyantsing's Blog

第77次课程_REDIS基础

字数统计: 126阅读时长: 1 min
2019/11/06

源辰76班

第77次课程

2019.11.06

内容

REDIS基础[廖彦]

1.客户端和服务端

**d578efea16924046ac1b286d368b1586.png

**

2.案例源码:

RedisBiz.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.yc.damai.biz;
import redis.clients.jedis.Jedis;
public class RedisBiz {
    public static void main(String[] args) {
       //创建redis连接
       Jedis jedis = new  Jedis("127.0.0.1",6379);
       try{
           //键 值
           jedis.set("book3", "redis");
           //list 键 值...
           jedis.lpush("books", "test",  "java", "c++");
       } finally {
           //关闭redis连接
           jedis.close();
       }
    }
}

3.Redis命令行

%!(EXTRA markdown.ResourceType=, string=, string=)

CATALOG