
Java开发
且随风而行
我欲乘风起,扶摇直上九万里
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
java获取访问的操作系统名称和版本
日志管理,获取访问的操作系统名称和版本。原创 2025-05-29 17:51:25 · 92 阅读 · 0 评论 -
Nacos连接不上:Ignore the empty nacos configuration and get it based on dataId
这次产生问题的原因为nacos版本配置问题,当nacos版本为1.0.x的时候需要指定group,而我用的nacos版本为2.0.4不需要指定group,去掉group即可找到配置文件正常运行。服务启动有警告信息:Ignore the empty nacos configuration and get it based on dataId。可正常连接nacos,未报nacos连接错误信息。application.yml文件配置正确。原创 2024-03-01 10:48:45 · 10760 阅读 · 0 评论 -
在localdatetime.now()的基础上加1s
在localdatetime.now()的基础上加1s原创 2023-03-09 11:16:04 · 945 阅读 · 0 评论 -
springboot启动报错Bean with name ‘xxxxService‘ has been injected into other beans快速处理方式
springboot启动报错Bean with name ‘xxxxService‘ has been injected into other beans快速处理方式原创 2023-03-01 16:26:54 · 3107 阅读 · 0 评论 -
java报错:Type handler was null on parameter mapping for property ‘*‘,jdbcType (null) combination.
Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'urlParams'. It was either not specified and/or could not be found for the javaType (com.alibaba.fastjson.JSONObject) : jdbcType (null) combination.原创 2023-02-21 16:20:29 · 15073 阅读 · 0 评论 -
java保存json类型数据到mysql数据库,mysql保存json类型数据
java保存json类型数据到mysql数据库,mysql保存json类型数据原创 2023-02-21 15:51:59 · 2217 阅读 · 0 评论 -
Mysql报错:Can’t create/write to file xxx (OS error 24 - Too many open file)的快速处理方法
Can't create/write to file '/tmp/MYg1SlCz' (OS errno 24 - Too many open files)原创 2022-10-26 16:24:55 · 1724 阅读 · 0 评论 -
关于java对特殊字符处理的一些理解和总结(密码校验和手机号校验)
介绍这段时间使用Java的正则表达式做一些字符串匹配的任务,现将学到的正则表达式的知识整理成文。Java中Spring.class涉及到正则表达式。如Spring.split(), matches(),replaceAll()等方法。Java中一般使用正则表达式的方式是利用Pattern.class和Matcher.class,所在package为java.util.regex。该篇主要针对字符进行总结,如下是构造正则表达式的常用字符字符类描述\将下一字符标记为特殊字符、文本原创 2022-03-17 16:04:22 · 1659 阅读 · 0 评论 -
idea下使用mybatis时,参数条件判断失效
如下图,当unitTypeExtend为0时,参数判断<if test="unitTypeExtend!= null and '' != unitTypeExtend ">失效,原因是因为当参数unitTypeExtend为0时,''!=unitTypeExtend 判断会将unitTypeExtend转化为空字符串去进行条件判断,导致条件判断失效因此当传值为数字类型时,如下图只需要判断unitTypeExtend!= null就行...原创 2022-02-16 10:11:41 · 666 阅读 · 1 评论 -
Mybatis下使用PageHelper插件,但是PageHelper.startPage()方法不起作用
阐述问题因为 com.github.pagehelper.PageHelper 分页有一个坑在里面,分页条件一定要放在查询正上方,如果中间加入其他查询条件,分页就会失效如下图:分页查询作用在basParameterService.getParameterIdByCode方法里的查询上:修改为以下代码分页即可正常生效:...原创 2022-02-11 10:18:03 · 1402 阅读 · 0 评论 -
LambaQueryWrapper的经常使用方法(修改、查询、删除)
public void main(String[] args) { //修改方法 String unitId = "1"; //将UnitCompanyCategory表下UnitId值为1对应的unitCategoryId字段数据改为1 String categoryId = "1"; LambdaUpdateWrapper<UnitCompanyCategory> lambdaUpdateWrapper = ne原创 2022-01-11 14:54:06 · 15803 阅读 · 6 评论 -
手机号、身份证数据后台脱敏,JAVA中split()特殊符号“.“ “|“ “*“ “\“ “]“处理
String credentialsNum = "4304****************79";String[] num = credentialsNum .split("\\*");system.out.println("num.lenth()=" + num.length())关于点的问题是用string.split("[.]") 解决。关于竖线的问题用 string.split("\\|")解决。关于星号的问题用 string.split("\\*")解决。关于斜线的问题用 sring原创 2021-12-20 14:26:02 · 1429 阅读 · 0 评论 -
mybatis分页查询数据重复问题解决
今天测试提出了个bug:分页查询出来的数据第二页与第三页的数据大部分相同查询数据库发现也是同样的数据,经过排查,是排序导致的问题,没有一个唯一值的字段排序导致排序混乱,所以加上一个唯一性的值就可以保证排序正常分页...原创 2021-12-07 11:18:23 · 2530 阅读 · 3 评论 -
使用Mybatis插件下时间类型LocalDateTime和LocalDate无法保存空数据问题
在实体类字段上加上@TableField(updateStrategy = FieldStrategy.IGNORED)就能解决时间类型参数无法保存的问题了。 /** * 购买时间 */ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @TableField(updateStrategy = FieldStrategy.IGNORED) private LocalDateTim.原创 2021-12-03 16:44:33 · 2137 阅读 · 0 评论 -
Java函数式编程Stream.collect()方法使用小结
steam():把一个源数据,可以是集合,数组,I/O channel, 产生器generator 等,转化成流。Collectors(): 类实现了很多归约操作,例如将流转换成集合和聚合元素。通过stream().collect()方法可简单获得我们所需要的数据结构。先创建一个prodList的集合数据@Datapublic class Product { private Long id; private Integer num; private BigDecimal pr原创 2021-11-23 11:46:37 · 22088 阅读 · 8 评论 -
idea打开拉下来的maven项目无法运行(快速解决方法)
首先选择pom文件右键添加为Maven Project然后在右侧maven标签下导入相关依赖包如果是分布式项目的话,就将相关模块项目的pom文件都放进来并导入相关依赖包可以正常运行项目了原创 2021-07-08 16:17:42 · 5159 阅读 · 1 评论 -
linux下tomcat项目中文名文件乱码问题
问题:linux下tomcat项目中文乱码问题通过在tomcat下的server.xml端口配置处添加useBodyEncodingForURI="true"URIEncoding="UTF-8"catalina.sh头位置添加export LANG=zh_CN.UTF-8就可解决中文乱码问题原创 2021-07-08 16:00:10 · 1229 阅读 · 0 评论 -
Unable to resolve table ‘xxx‘简单的解决方法(无需配置数据库)
问题:数据库提交代码时报Unable to resolve table ‘xxx‘错误解决方案:修改Idea配置打开idea下的Settings设置Inspaections查找sql配置Unresolved reference勾选去掉后保存可以正常提交代码原创 2021-07-08 15:50:49 · 8019 阅读 · 7 评论 -
tomcat项目在Linux下生成文件路径错误问题
linux下路径保存错误linux下保存错误,这是因为在windows上文件分隔符是“\”,在linux上文件分割符是“/”,所以所以往linux服务上部署时要记得更改分隔符。String separator = File.separator;这样子通过separator获取到的分隔符在windows上文件分隔符是“\”,在linux上文件分割符是“/”。例子:String fileUrl = separator + “aers” + separator + “fileDate” + separat原创 2020-12-25 13:55:00 · 581 阅读 · 0 评论 -
修改echarts图表字段显示大小
修改echarts图表字段显示大小原创 2020-11-19 18:00:59 · 3617 阅读 · 0 评论 -
mysql查询数据存在但是点击显示为空(JSP页面数据显示换行)
产生原因:由于mysql库中有的字段会有换行符,导致无法用这些字段进行查询,查询结果为空。解决方法//先查询数据是否存在换行符select * from table where column like '%\r\n%'//如果存在则将换行符替换为""字符串update table(表) set column(字段名) = replace (username,"\r\n","");...原创 2020-06-22 17:02:46 · 723 阅读 · 0 评论 -
Hibernate SQLQuery 原生SQL参数赋值自设,防止数据泄露(安全性)
安全性考虑通常我们写sql语句代码的时候都是直接把需要查询的数据赋值给参数,这样的话可能会引发安全问题,因此要使用Hibernate 的原生sql来保证数据的安全。参数值自设储存String sql = "select * from pubuser where str1 = ? and str2 = ? and str3 = ?";getEntityDao().executeSQL(sql.toString(), str1, str2, ---);通常原生sql我们都是通过这个格式来进行查询。但原创 2020-05-21 16:29:54 · 907 阅读 · 0 评论 -
layui渲染问题包括select下拉框渲染问题
layui动态获取数据渲染使用layui前端框架时,很多时候通过动态表格方法得到数据后无法显示,是因为没有进行数据渲染。比如说下图中年份selelct多选框的数据获取。JSP页面代码<label class="layui-form-label">  年份</label> <div class="layui-input-inline"> <select class="" id="year"原创 2020-05-14 18:45:04 · 2370 阅读 · 2 评论 -
layui下layui.verify自定义规则验证表单字段
layui.verify自定义规则说明在自己需要进行进行验证的字段里添加lay-verify的属性字段,如我下段代码中的lay-verify="require|character",然后在后面form表单的功能里下添加form.verify,自己在里面设置需要验证的方法。<label class="layui-form-label2"><span style="color: red">*</span>设置名称</label><div class="原创 2020-05-12 18:41:50 · 4681 阅读 · 2 评论 -
关于java用Quertz定时进行数据库同步的简单操作
1. 首先需要添加定时器Quertz的依赖 org.quartz-scheduler quartz 2.3.02. 定时器Quertz的xml文件配置 <bean id="synchroEventReportTask" class="org.hyena.aers.task.SynchroEventReportTask"></bean> <!-- 设定执行代码中的具休方法 --> <bean id="synchroEven原创 2020-05-11 18:52:09 · 1695 阅读 · 1 评论