2 Star 0 Fork 0

Ryeoyeong/数据库课程设计

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Redis.java 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
Ryeoyeong 提交于 2023-06-28 06:37 . 完善功能的学生端1.0
package sqltest;
import redis.clients.jedis.Jedis;
public class Redis {
public void setRedis(String sno,String password){
redis.clients.jedis.Jedis jedis=new redis.clients.jedis.Jedis("192.168.232.1",6379);
String result=jedis.ping();
System.out.println(result);
String sno_pwd=sno+"-"+password;
jedis.set("sno-pwd",sno_pwd);
jedis.close();
}
public String getSno(){
redis.clients.jedis.Jedis jedis=new redis.clients.jedis.Jedis("192.168.232.1",6379);
String result=jedis.ping();
System.out.println(result);
String sno=jedis.get("sno");
jedis.close();
return sno;
}
public void setSno(String sno){
redis.clients.jedis.Jedis jedis=new redis.clients.jedis.Jedis("192.168.232.1",6379);
String result=jedis.ping();
System.out.println(result);
jedis.set("sno",sno);
jedis.close();
}
public void delSno(){
redis.clients.jedis.Jedis jedis=new redis.clients.jedis.Jedis("192.168.232.1",6379);
String result=jedis.ping();
System.out.println(result);
jedis.del("sno");
jedis.close();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/ryeoyeong/database-course-design.git
git@gitee.com:ryeoyeong/database-course-design.git
ryeoyeong
database-course-design
数据库课程设计
master

搜索帮助