JDBC连接数据库 需提前导入驱动包 package com.admin; import java.sql.*; public class Main { public static void main(String[] args) throws SQLException { ...
使用同步锁来实现线程安全---生产者与消费者 当仓库满了时才允许消费者消费,当仓库为空时,才允许生产者生产 生产者类 package com.goodwe.entity; import java.util.Queue; /** * @Author : Wang Huyun * @Creation time :...
统计txt文件中每个字符出现的次数,并根据次数从高到低排序 使用HashMap来存放信息 /* * @Description //main函数 * @Param * @return **/ import java.io.*; import java.util.*; public class HelloServer...
文件操作 1.读取txt文件内容 // 从txt文件中读取字符 File txtxfile = new File("C:\\Users\\Administrator\\Desktop\\test.txt"); FileInputStream fr = new FileInputStream(txt...
springboot使用Layer上传图片 1.html <button style="margin-top: 20px;margin-left: 20px" type="button" class="layui-btn" id="upload"> <i class="layui-icon">&...
kafka的基本点 kafka节点之间如何复制备份的? Log的分区被分布到集群中的多个服务器上。每个服务器处理它分到的分区。 根据配置每个分区还可以复制到其它服务器作为备份容错。 每个分区有一个leader,零或多个follower。Leader处理此分区的所有的读写请求,而follower被...
Springboot中使用阿里云短信验证码服务 1.引入阿里云的包 <dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> &l...
springboot中使用kafka kafka配置文件 package com.goodwe.kafka.configuration; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.seri...
Springboot常使用配置属性 #端口号 server.port=8080 #分页行数 pager.size=10 #log logging.config=classpath:logback.xml #thymelea spring.thymeleaf.prefix=classpath:/templ...
springboot中使用Mybatis_plus 代码生成器 package com.goodwe.daomain; import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException; import com.baomidou.mybatisplus.core.t...
Springboot中自定义文件映射 //配置 package com.goodwe.admin.configure; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.c...
Springboot中使用Shiro的配置与realm的构建 //shiro配置 package com.goodwe.admin.configure; import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.spring.security.intercept...
Springboot中使用Redis的配置 package com.goodwe.admin.configure; import com.alibaba.fastjson.support.spring.FastJsonRedisSerializer; import org.springframework.context.an...
记录Springboot+Mybatis_Plus进行CRUD与分页的注意点 对于mybatis_plus来说,进行CRUD非常的方便,但是最近遇使用其分页插件时遇到了一个问题,记录一下. 当进行Mybatis_plus的版本升级时,需要查看升级文档. 比如当版本从3.0.6升级到3.1.0时,文档中说明移除对mybatis-plus-generator包的依赖,自己...