随笔分类 - JAVAWEB 学习
摘要:if: @Test public void testList(){ List<Emp> empList = empMapper.list("张", null, null, null); System.out.println(empList); } 点击查看代码 <?xml version="1.0"
阅读全文
摘要:根据主键删除: @Delete("delete from emp where id = #{id}") public void delete(Integer id); @Test public void testDelete(){ empMapper.delete(16); System.out.p
阅读全文
摘要:配置: JDBC: 原始HDBC的问题: 数据库连接池: lombok:
阅读全文
摘要:介绍: 结构: 语法: create index i on tb_emp(name); show index from tb_emp; drop index i on tb_emp;
阅读全文
摘要:操作: start transaction; delete from tb_dept where id=2; delete from tb_emp where dept_id 2; commit; rollback ;只要有失败就可以回滚 四大特性ACID: 总结:
阅读全文
摘要:select * from tb_emp,tb_dept;这样会产生笛卡尔积 加上条件即可: select * from tb_emp,tb_dept where tb_emp.dept_id=tb_dept.id; 内连接: 隐式内连接: select tb_emp.name,tb_dept.na
阅读全文
摘要:统计员工性别并返回数据: select if(gender=1,'man','women') 性别,count(*) from tb_emp group by gender; 统计员工职位并返回数据: select case job when 1 then '班主任' when 2 then '讲师
阅读全文
摘要:基本查询: 查询特定列: select name,entrydate from tb_emp; 查询所有: select * from tb_emp; 查询并起别名: select name as bbb,entrydate as aaa from tb_emp; (as可省略) 去除重复记录: s
阅读全文
摘要:指定字段添加 insert into tb_emp(username,name,gender,create_time,update_time) values ('wuji','无极','1',now(),now()); 为所有字段添加 insert into tb_emp(id, username,
阅读全文
摘要:点击查看代码 ```plaintext create table tb( id int comment 'ID', username varchar(20) comment '用户名', name varchar(10) comment '姓名', age int comment '年龄', gen
阅读全文
摘要:不便管理,难以维护 统一响应结果: 实战案例: 点击查看代码 ```plaintext @RestController public class emp { @RequestMapping("/listEmp") public Result list() { //加载解析emp.xml文件 Stri
阅读全文
摘要:apipost插件,用于测试 1. 简单参数 通过request手动获取请求参数: @RestController public class easy { @RequestMapping("/easyget") public String easyget(HttpServletRequest req
阅读全文
摘要:springboot内嵌 入门程序: 在web开发环境中集成了tomcat
阅读全文
摘要:头和体空行; GET具体体现:在请求路径之后+ ? + k=value (&) 实现; 状态码分类: 常见状态码: 响应头分类:
阅读全文
摘要:package com.study.maven.java_web.hello; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.
阅读全文

浙公网安备 33010602011771号