自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 收藏
  • 关注

原创 12-Mysql常用函数

Mysql常用函数-- 数学运算select ABS(-8) -- 绝对值select celling(9.4) -- 10 向上取整select floor(9.4) -- 9 向下取整select rand() -- 返回一个 0~2之间的随机数-- 字符串select char_length('一二三') -- 3 字符串长度select concat('我','like','编程') -- 拼接字符串select lower('ZHANGsan') -- 转小写se

2021-09-28 13:43:13 65

原创 11-子查询和嵌套查询

子查询和嵌套查询子查询where (值是固定的)where (select * from)-- 查询java 的所有考试结果(学号 科目编号 成绩)降序排列-- 也可以用联表查询select `studentNo`,`subjectNo`,`studentResult`from `result` where subjectNo( select subjectNo from subject where subjectName='java')order by studentResul

2021-09-28 13:42:41 118

原创 10-分页和排序

分页和排序分页写在order by 后面-- limit 起始值,展示的多少-- 从0开始,每页显示5条limit 5; == limit 0,5;-- 第一页limit 0,5 (1-1)*5-- 第二页 limit 5,5 (2-1)*5-- 第三页limit 10,5 (3-1)*5-- 第N页1imit 0,5(n-1) * pagesize. pagesize-- 【pagesize:页面大小】-- 【(n-1)* pagesize:起始值】--

2021-09-28 13:42:12 101

原创 09-联表查询

联表查询join-- 查询的字段来自哪些表 (连接查询)-- inner joinselect a.studentNo,a.studentName,b.studentScorefrom 表1 as ainner join 表2 as bwhere a.studentNo=b.studentNo-- right joinselect a.studentNo,a.studentName,b.studentScorefrom 表1 as aright join 表2 as bon

2021-09-28 13:41:36 88

原创 08-where子句与模糊查询

where子句之逻辑运算符作用:检索数据中符合条件的值搜索的条件由一个或者多个表达式组成! 结果为 布尔值运算符语法描述and &&a and b a && b逻辑与,两个都为真,结果为真or ||a or b a|| b逻辑或,其中一个为真,结果为真not !not a !a逻辑非,真为假,假为真尽量使用英文模糊查询运算符语法描述IS NULLa is nu

2021-09-28 13:41:03 273

原创 07-DQL查询语言

DQL查询语言-- 查询所有的学生select * from student-- 查询指定字段select `studentId`,`studentName` from student-- 别名 as 或空格 字段、表都可以起别名select `studentId` as 学号,`studentName` 学生姓名 from student as s-- 函数 concat(a,b)select concat('姓名:',studentName) as 新名字 from studen

2021-09-28 13:40:33 95

原创 06-mysql数据管理

mysql数据管理外键(了解即可)-- 1.建表就创-- 2.创完表再创建DML语言增insert into 表名 (`字段一`,`字段二`,...) values ('值1','值2',...)可以同时插入多条记录,values后面的值,需要使用,隔开删deletedelete from 表名 where 条件delete from 表名 where id=1-------------------------------------truncatetruncat

2021-09-26 14:19:43 60

原创 05-数据库的字段属性

数据库的字段属性unsigned无符号的整数声明了该列不能声明为负数zerofill0填充的不足的位数,使用0来填充,int (3) . 5 — 0o5自增通常理解为自增,自动在上一条记录的基础上+1(默认)通常用来设计唯一的主键~ index,必须是整数类型可以自定义设计主键自增的起始值和步长**非空 ** NULL not null假设设置为not null ,如果不给它赋值,就会报错!Null,如果不填写值,默认就是null!扩展:听听就好/*每一个表

2021-09-26 14:19:10 95

原创 04-列的数据类型讲解

列的数据类型讲解数值tinyint 十分小的数据 1个字节smallint较小的数据 2个字节mediumint 中等大小的数据3个字节int 标准的整数 4个字节―常用的intbigint 较大的数据 8个字节float 浮点数 4个字节double 浮点数 8个字节―(精度问题!)decimal 字符串形式的浮点数金融计算的时候,一般是使用decimal字符串char字符串固定大小的0~255varchar可变字

2021-09-26 14:18:39 124

原创 03-基本的命令行操作

基本的命令行操作 -- SQL注释 (--空格) update mysq1.user set authentication_string=password('123456') where user='root' and Host =' loca1host'; -- 修改用户密码flush privileges; -- 刷新权限数据库xxx语言 CRUD增删改查DDL定义DML操作DQL查询DCL控制操作数据库-- 加个数据库create database if not e

2021-09-26 14:18:07 151

原创 01-什么是数据库,为什么要学习数据库

什么是数据库,为什么要学习数据库Javatee: 企业Java开发 web前端(页面:展示。数据!)后台(连接点:连接数据库JDBC,链接前端(控制,控制视图跳转,和给前端传递数据))数据库(存数据,Txt,Excel,word)为什么要学习数据库1、岗位需求2、现在的世界,大数据时代~,得数据库者得天下。3、被迫需求:存数据|4、数据库是所有软件体系中最核心的存在DBA1.1、什么是数据库数据库(DB,DataBase)概念:数据仓库,软件安装在操作系统(window ,linux

2021-09-26 14:16:58 443

原创 29-定时任务

定时任务cron表达式可以用在线cron编辑器1.开启注解支持@EnableScheduling //开启定时功能的注解@SpringBootApplicationpublic class Spring09TestApplication { public static void main(String[] args) { SpringApplication.run(Spring09TestApplication.class, args); }}2.s

2021-09-26 13:56:35 179

原创 28-邮件任务

邮件任务1.导包<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>2.配置spring.mail.username=2545644870@qq.comspring.mail.password=gmxawscfvzvoecj

2021-09-26 13:56:00 267

原创 27-异步任务

异步任务1.创建新项目2.service层@Servicepublic class AsyncService { //告诉spring这是一个异步的方法 @Async public void hello(){ try { Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); }

2021-09-26 13:55:30 70

原创 26-Swagger

前后端集成联调,前端人员和后端人员无法做到“即使协商,尽早解决”,最终导致问题集中爆发;解决方案:首先指定schema[计划的提纲],实时更新最新API,降低集成的风险;·早些年:指定word计划文档;前后端分离:。前端测试后端接口:postman。后端提供接口,需要实时更新最新的消息及改动!Swagger解决以上问题号称最流行的框架Springboot集成Swagger1.创建新springboot项目2.导入jar包<!-- 3.0.0需要加入启动包 --.

2021-09-26 13:54:52 76

原创 25-shiro整合thymeleaf

shiro整合thymeleaf效果就是对应的权限展示对应的页面1.导包<!-- shiro-thymeleaf整合 --> <dependency> <groupId>com.github.theborakompanioni</groupId> <artifactId>thymeleaf-extras-shiro</artifactId>

2021-09-23 15:54:26 130

原创 24-shiro请求授权实现

shiro请求授权实现1.configShiroConfig //添加shiro的内置过滤器 Map<String, String> map = new LinkedHashMap<>(); //-------------授权,正常情况,未授权会跳转带未授权页面 //限制访问add页面,和update页面 map.put("/user/add","perms[user:add]"); map

2021-09-23 15:53:52 121

原创 23-shiro整合mybatis

shiro整合mybatis1.导包<!-- 整合mybatis--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <dependency>

2021-09-23 15:52:43 156

原创 22-shiro实现用户认证

shiro实现用户认证1.前端登录表单提交后2.configUserRealm @Override protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException { System.out.println("执行了认证"); String name="root"; String p

2021-09-23 15:52:03 147

原创 21-shiro实现登录拦截

shiro实现登录拦截1.configShiroConfig//ShiroFilterFactoryBean :3 @Bean public ShiroFilterFactoryBean getShiroFilterFactoryBean(@Qualifier("securityManager") DefaultWebSecurityManager defaultWebSecurityManager){ ShiroFilterFactoryBean bean =

2021-09-23 15:50:49 246

原创 20-springboot整合shiro

springboot整合shiro三大对象subjectsecurity managerrealm搭建环境1.导包<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.7.1</version&g

2021-09-23 15:49:50 81

原创 19-记住我及首页定制

记住我及首页定制//开启记住我功能 cookie 默认两周http.rememberMe();定制自己的登录页<!DOCTYPE html><html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"><head> <meta charset="UTF

2021-09-20 17:39:47 81

原创 18-注销及权限控制

注销及权限控制注销前端<a th:href="@{/logout}">注销</a><!--这个logout请求是security的-->注销后端config //注销,开启注销功能,跳到首页 http.logout().logoutSuccessUrl("/");权限控制导包 <dependency> <groupId>org.thymeleaf.extras</groupId>

2021-09-20 17:39:13 87

原创 17-用户认证和授权

用户认证和授权导包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>configpackage com.tian.config;import org.sprin

2021-09-20 17:38:31 135

原创 16-SpringSecurity环境搭建

SpringSecurity环境搭建在web开发中,安全第一位! 过滤器,拦截器~功能性需求:否做网站:安全应该在什么时候考虑?设计之初!漏洞,隐私泄露~架构一旦确定~shiro、SpringSecurity:很像~除了类不一样,名字不一样;认证,授权(vip1,vip2,vip3)导包创建项目记得勾选web导入thymeleaf包结构...

2021-09-20 17:38:03 124

原创 15-整合Druid数据源

整合Druid数据源导入依赖 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.9</version> </dependency>配置druid的配置网上去搜application.y

2021-09-18 16:54:02 91

原创 14-整合Mybaits数据库

整合Mybaits数据库(重点)1. 导包 <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>2.2.0</version> </depe

2021-09-18 16:53:27 161

原创 13-整合JDBC使用

整合JDBC使用创建一个新项目连接数据库spring: datasource: username: root password: root url: jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC&useUnicode=ture&characterEncoding=utf-8 driver-class-name: com.mysql.cj.jdbc.Driver先测试数据库连接

2021-09-18 16:52:45 92

原创 12-员工管理系统

员工管理系统准备工作pojoDepartment@Data@NoArgsConstructor@AllArgsConstructorpublic class Department { private Integer id; private String departmentName;}Employeeimport java.util.Date;@Data@NoArgsConstructorpublic class Employee { private I

2021-09-16 11:51:01 255

原创 11-mvc配置原理

mvc配置原理扩展springmvcpackage com.kuang.config;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.EnableWebMvc;import org.springframework.web.servlet.config.annotation.ViewControllerRegis

2021-09-16 11:44:58 126 2

原创 10-thymeleaf模板引擎

thymeleaf模板引擎1.引入依赖<dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf-spring5</artifactId></dependency><dependency> <groupId>org.thymeleaf.extras</groupId> <artif

2021-09-14 12:00:31 98

原创 09-首页和图标定制

首页和图标定制首页图标定制1.图片命名为favicon.ico2.放在public目录下3.更改配置#关闭默认图标 ,新版本没有spring.mvc.favicon.enabled=false4.测试访问

2021-09-14 11:59:45 71

原创 08-静态资源导入

静态资源导入创建时要勾选web自定义静态资源位置(但是一般不会这么干)

2021-09-12 14:06:03 81

原创 07-多环境配置及配置文件位置

多环境配置及配置文件位置application.yml优先级优先级顺序(最简单的端口号测试)多环境配置用 " — "来区别各个环境

2021-09-12 14:04:31 70

原创 06-JSR303校验

JSR303校验

2021-09-12 14:03:36 83

原创 05-yaml给实体类赋值

yaml给实体类复制准备工作pojoDog//@Component为了更容易被扫描@Componentpublic class Dog { private String name; private Integer age;//有参无参 setter getter toString}Person@Component//@ConfigurationProperties(prefix = "person") 相当于绑定了application.yaml里面的person/

2021-09-09 23:37:55 207

原创 04-yaml语法讲解

yaml语法讲解application.properties删掉官方推荐application.yamlyaml语法(注意空格)#properties只能保存键值对!#key=value# server.port=8081#对象student.name=张三student.age=18# yaml语法# 对空格的要求十分高server: port: 8081#key: valuestudent: name: 张三 age: 18#行内写法stude

2021-09-09 23:36:38 95

原创 03-自动装配原理

自动装配原理pom.xmlspring-boot-dependencies:核心依赖在父工程中!我们在写或者引入一些SPringboot依赖的时候,不需要指定版本,就因为有这些版本仓库结论: springboot所有自动配置都是在启动的时候扫描并加载: spring.factories所有的自动配置类都在这里面,但是不一定生效,要判断条件是否成立,只要导入了对应的start,就有对应的启动器了,有了启动器,我们自动装配就会生效,然后就配置成功!1. springboot在启动的时候,从类路

2021-09-08 14:40:06 255

原创 02-第一个springboot程序

第一个springboot程序官方:提供了一个快速生成的网站! IDEA集成了这个网站!可以在官网直接下载后,导入idea开发(官网在哪)直接使用idea创建一个springboot项目(一般开发直接在IDEA中创建)idea创建new module->Spring Initializr->next加入依赖就不会停止 <dependency> <groupId>org.springframework.boot</group

2021-09-08 14:38:15 65

原创 01-springboot

什么是springboot微服务阶段微服务阶段javase: OOPmysql:持久化html+css+js+jquery+框架:视图,框架不熟练,Css不好; javaweb:独立开发MVC三层架构的网站了:原始ssm:框架:简化了我们的开发流程,配置也开始较为复杂;war: tomcat运行spring再简化: SpringBoot-jar:内嵌tomcat;微服务架构! 服务越来越多: springcloud;学习路程(约定大于配置)简单来说就是整合所有的框架的框架

2021-09-08 14:36:46 68

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除