- 博客(5)
- 收藏
- 关注
原创 javaweb知识点
我们的问题 1. 重定向和请求转发的区别? 2. cookie和session的区别? 1.重定向和请求转发的区别? 重定向:客户端重新发送新的请求,无法request携带数据。地址栏会发生改变。 请求转发: 地址栏不会发生改变,在服务器端完成,效率高 使用request携带数据。 request.setAttribute(key,value); request对象存放数据 request.getAttribute(key); request对象获取数据 请求跳转和重定向跳转的区别
2021-10-26 19:16:03
144
原创 MySql查询语句练习题
1、 查询Student表中的所有记录的Sname、Ssex和Class列。 select sname,ssex,class from student 2、 查询教师所有的单位即不重复的Depart列。 select distinct depart from teacher 3、 查询Student表的所有记录。 select*from student 4、 查询Score表中成绩在60到80之间的所有记录。 select*from score where degree between 60 and.
2021-10-25 09:51:37
414
原创 BaseDao 增删改抽取
//增删改的公共方法 public int update(String sql,Object... params){ try { getConnection(); ps = connection.prepareStatement(sql); //为占位符赋值 for (int index=0;index<params.length;index++){ ps.setObject(index+1,params[...
2021-10-25 09:47:46
119
原创 把数据库的信息抽取到properties文件取
(1)在src根目录下创建一个db.properties # =后不能使用“ ” username=root password=root driverName=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/world?serverTimezone=Asia/Shanghai (2) 读取属性文件中的内容
2021-10-25 09:45:43
119
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人