自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 资源 (4)
  • 问答 (1)
  • 收藏
  • 关注

原创 Jackson 全局序列化配置的2种实现方式(@Bean注解创建ObjectMapper、重写configureMessageConverters方法)

1 @Bean注解创建ObjectMapper实现1.1JsonConfig全局序列化配置类。package com.config;import com.fasterxml.jackson.databind.DeserializationFeature;import com.fasterxml.jackson.databind.ObjectMapper;import com.fasterxml.jackson.databind.module.SimpleModule;import .

2021-09-30 16:18:02 6211 1

原创 Java Double类型出现科学计数法问题解决

问题描述:Double num1=0.0004;问题分析:1、当数据足够小或者足够大时,Double会将数据自动变成科学计数法。解决办法:将Double类型先变成String类型,再将String类型变为BigDecimal即可。Double num1 = 0.0004;String strNum = NumberUtil.toStr(new BigDecimal(num1.toString()));//0.0004注:NumberUtil需要引入Hutool依赖才可.

2021-09-29 09:44:58 12074

原创 MyBatis-Plus Page类的total值为0问题解决

问题描述:Page类records能查询到数据,但是total值一直为0。问题分析:1、没有创建MybatisPlusInterceptor(MyBatisPlus分页拦截器)实例,导致total值一直为0。解决办法:创建MybatisPlusInterceptor实例。具体解决办法请查看以下博客。MyBatis-Plus 实现2种分页方法(QueryWrapper查询分页、SQL查询分页)_旭东怪的博客-CSDN博客https://blog.csdn.net/qq_389746

2021-09-28 09:02:08 17173 1

原创 Java Error creating bean with name:Bean with name has been injected into other beans in its raw问题解决

问题描述:Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userServiceImpl': Bean with name 'userServiceImpl' has been injected into other beans [userLogServiceImpl] in its raw version as part of a

2021-09-27 17:55:18 7814

原创 Java java.sql.SQLSyntaxErrorException: Unknown column ‘xxx‘ in ‘where clause‘

问题描述:java.sql.SQLSyntaxErrorException: Unknown column 'user_name' in 'where clause'问题分析:1、where语句里面出现不存在的字段名。select username,password from userswhere user_name = '123';解决办法:仔细检查where语句确保里面没有不存在的字段名。select username,password from userswhe

2021-09-26 17:16:18 6590

原创 Java java.sql.SQLSyntaxErrorException:Duplicate column name ‘xxx‘问题解决

问题描述:java.sql.SQLSyntaxErrorException: Duplicate column name 'username'; bad SQL grammar [];问题分析:1、建表语句中设置索引的字段出现了两个username。 CREATE TABLE users( `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT

2021-09-25 22:35:25 6429

原创 Java Communications link failure.The last packet successfully received from the server was问题解决

问题描述:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure问题分析:1、数据库已关闭当前连接,导致报错。

2021-09-24 10:53:18 8640 1

原创 Java All parts of a PRIMARY KEY must be NOT NULL;if you need NULL in a key,use UNIQUE instead问题解决

问题描述:Cause: java.sql.SQLSyntaxErrorException: All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead问题分析:1、设为主键的字段设置了可以为null。 CREATE TABLE users( `username` varchar(20) CHARACTER SET utf8 COLL

2021-09-23 21:07:58 8565

原创 Spring Boot 配置Kaptcha(谷歌验证码工具)(生成验证码、验证验证码)

1Kaptcha1.1 Kaptcha简介Kaptcha 是一个可高度配置的实用验证码生成工具,可自由配置的选项如:(1)验证码的字体(2)验证码字体的大小(3)验证码字体的字体颜色(4)验证码内容的范围(数字,字母,中文汉字!)(5)验证码图片的大小,边框,边框粗细,边框颜色(6)验证码的干扰线(7)验证码的样式(鱼眼样式、3D、普通模糊、...)1.2Kaptcha详细配置表Kaptcha常用属性 序号 属性名 描述 示例 1 ..

2021-09-22 21:09:52 6072 1

原创 Navicat Lost connection to MySQL server during query问题解决

问题描述:执行SQL语句查询时间过长。问题分析:1、Navicat设置默认连接间隔为240秒,所以会出现查询时间过长的情况。解决办法:将保持连接间隔为10秒即可。

2021-09-21 21:24:14 4609

原创 Java Can not read response from server.Expected to read bytes,read bytes before connection问题解决

问题描述:Cause: java.sql.SQLException: Can not read response from server. Expected to read 102 bytes, read 99 bytes before connection was unexpectedly lost问题分析:1、mysql数据库的等待时长小于项目配置的最大等待时长,导致报错。解决办法:(1)数据库等待时长不变,项目的最大等待时长设为28800。(2)项目的最大等待时..

2021-09-20 22:59:50 13878 1

原创 CentOS You need to be root to perform this command问题解决

问题描述:You need to be root to perform this command.问题分析:1、需要root超级管理员权限才能执行特定命令。解决办法:输入命令su,并输入密码,切换至root超级管理员即可。

2021-09-19 21:50:42 8924 1

原创 Spring Boot 实现监控子线程的执行结果2种方法(Future.isDone()、事件监听器)

1 Maven依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <!--hutool工

2021-09-18 22:23:43 2462 2

原创 Spring Boot 调用@Async异步方法创建线程2种方式(调用外部的异步方法,调用内部的异步方法)

1 Maven依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <!--hutool工

2021-09-17 15:06:39 859

原创 CentOS Another app is currently holding the yum lock; waiting for it to exit问题解决

问题描述:Another app is currently holding the yum lock; waiting for it to exit... The other application is: yum Memory : 77 M RSS (402 MB VSZ) Started: Tue Sep 14 06:14:10 2021 - 02:31 ago State : Sleeping, pid: 2611问题分析:1、yum被进程锁住了,无法再次使...

2021-09-16 22:29:59 274

原创 CentOS xx is not in the sudoers file.This incident will be reported问题解决

问题描述:sa is not in the sudoers file. This incident will be reported.问题分析:1、当前用户不在sudoers文件中,导致报错。解决办法:第一步,输入su,回车后输入root的密码即可切换到root用户第二步,输入命令chmod u+w ../etc/sudoers,添加sudoers文件的写权限。若当前目录不是用户目录,则需要输入命令cd ~切换到用户目录下。...

2021-09-15 20:53:16 1509

原创 Spring Boot配置QueryDSL(生成Query查询实体类,查询数据)

1 QueryDSLQueryDSL仅仅是一个通用的查询框架,专注于通过Java API构建类型安全的SQL查询。Querydsl可以通过一组通用的查询API为用户构建出适合不同类型ORM框架或者是SQL的查询语句,也就是说QueryDSL是基于各种ORM框架以及SQL之上的一个通用的查询框架。借助QueryDSL可以在任何支持的ORM框架或者SQL平台上以一种通用的API方式来构建查询。目前QueryDSL支持的平台包括JPA,JDO,SQL,J...

2021-09-14 14:33:23 4793 4

原创 Java Iterator转换成List3种方式(while循环、forEachRemaining()、StreamSupport.stream())

1 while循环 Iterator<String> stringIterator = new ArrayList<>(Arrays.asList("a", "b", "c")).iterator(); //使用while循环将Iterator转换成List List<String> list = new ArrayList<>(); while (stringIterator.hasNext

2021-09-14 14:24:44 5576

原创 JPA 使用SQL语句查询数据的两种方式(@Query注解、EntityManager类)

1 Maven配置 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</grou

2021-09-11 12:38:17 3315 1

原创 Java java.sql.SQLIntegrityConstraintViolationException:Duplicate entry ‘xx‘ for key ‘xx.PRIMARY‘问题解决

问题描述:Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '111' for key 'users.PRIMARY'问题分析:1、要插入的数据里面存在主键重复的情况,导致报错。解决办法:检查导致插入数据主键重复的原因,保证主键唯一即可。...

2021-09-10 17:10:40 5843

原创 Java SQLSyntaxErrorException: Key column ‘xxx‘ doesn‘t exist in table问题解决

问题描述:Cause: java.sql.SQLSyntaxErrorException: Key column 'user_name' doesn't exist in table问题分析:1、设置主键的字段名称在表格中不存在,导致报错。 CREATE TABLE users( `username` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名

2021-09-10 16:33:47 8462

原创 MyBatis-Plus Error attempting to get column ‘x‘ from result set.Cannot convert x ‘x‘ to x value问题解决

问题描述:org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'create_by' from result set. Caused by: com.mysql.cj.exceptions.DataConversionException: Cannot convert string '190166495383662592' to java.sql.Timestamp value

2021-09-09 09:21:48 1276 1

原创 JPA Failed to create query for method public abstract;No property xxx found for type xxx问题解决

问题描述:Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.dao.UserRepository.getUserEntityListByUsernameGreaterThanEquals(java.lang.String)! No property greaterThan found for type String! Tra

2021-09-08 21:57:09 5850

原创 JPA 根据解析方法名自定义查询方法(逻辑判断、相等判断、范围判断、非空判断、模糊匹配、in判断、布尔值判断、排序)

1方法签名方法签名由动词+主题+关键词+断言+限制条件组成。package com.dao;import com.entity.UserEntity;import org.springframework.data.jpa.repository.JpaRepository;import org.springframework.data.jpa.repository.JpaSpecificationExecutor;import org.springframework.stereotype.

2021-09-08 21:44:14 1979

原创 Nacos IllegalStateException:failed to req API:/nacos/v1/ns/instance/list after all servers([x])问题解决

问题描述:java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance/list after all servers([localhost:8848]) tried: failed to req API:localhost:8848/nacos/v1/ns/instance/list. code:500 msg: java.net.SocketTimeoutException: connect timed out问题

2021-09-07 16:42:44 6492

原创 Spring Boot配置多线程(创建线程池、创建线程)

1AsyncConfig多线程配置类。package com.config;import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframew.

2021-09-06 21:32:33 1326

原创 JPA 内置方法使用(保存方法、删除方法、查询方法)

1 保存方法1.1 save()保存单条数据,存在则更新,不存在则插入。 /** * 保存用户 * * @param userEntity 用户信息 * @return */ public UserEntity save(UserEntity userEntity) { return userRepository.save(userEntity); }1.2saveAll()批量保存数据,存在则更.

2021-09-04 11:30:08 2971

原创 POI The maximum number of Cell Styles was exceeded.You can define up to x style in a x Workbook问题解决

问题描述:java.lang.IllegalStateException: The maximum number of Cell Styles was exceeded. You can define up to 64000 style in a .xlsx Workbook问题分析:1、使用EasyExcel创建单元格样式时,有64000个单元格创建了单元格样式,导致报错。 /** * 导出(设置单元格样式) * * @param response

2021-09-03 16:20:50 3339 1

原创 Hutool cn.hutool.core.date.DateException: No format fit for date String [xxx]问题解决

问题描述:cn.hutool.core.date.DateException: No format fit for date String [2021-06-30 11:22:33.1000] !问题分析:1、使用DateUtil.parse()将字符串转换为Date对象,由于传参格式不对导致报错。解决办法:使用yyyy-MM-dd HH:mm:ss.SSS格式。Date date = DateUtil.parse("2021-06-30 11:22:33.100");注:更多常.

2021-09-02 17:48:30 16047

原创 Hutool DateUtil所支持的常用日期格式

序号 日期格式 示例 1 yyyy/MM/dd HH:mm:ss 2021/06/30 11:22:33 2 yyyy.MM.dd HH:mm:ss 2021.06.30 11:22:33 3 yyyy年MM月dd日 HH时mm分ss秒 2021年06月30日 11时22分33秒 4 yyyy-MM-dd 2021-06-30 5 yyyy/MM/dd 2021/06/30 6 yyyy.MM.dd

2021-09-02 17:47:26 4830

原创 Dubbo Failed to check the status of the service.No provider available for the service from问题解决

问题描述:Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.service.UserService.No provider available for the service com.service.UserService from the url spring-cloud://localhost:9090/org.apache.dubbo.registry.Regist

2021-09-02 16:20:06 1371 1

原创 JPA Error creating bean with name defined in class path resource;Invocation of init method fail问题解决

问题描述:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method

2021-09-01 19:17:43 2525 1

原创 JPA Could not load requested class;Unable to resolve name [x] as strategy[x]问题解决

问题描述:Caused by: java.lang.ClassNotFoundException: Could not load requested class : mysqlCaused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [mysql]Caused by: org.hibernate.boot.registry.selector.spi.Strat

2021-09-01 19:15:18 2049

原创 JPA org.hibernate.service.spi.ServiceException: Unable to create requested service [xxx]问题解决

问题描述:Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]问题分析:1、Spring Boot配置里面没有设置数据库类型,导致报错。解决办法:(1)使用spring.datasource.platform设置数据库类型。spring.datasourc

2021-09-01 19:12:54 2958

时间片轮转调动算法

时间片轮转调度是一种最古老,最简单,最公平且使用最广的算法。每个进程被分配一个时间段,称作它的时间片,即该进程允许运行的时间。如果在时间片结束时进程还在运行,则CPU将被剥夺并分配给另一个进程。如果进程在时间片结束前阻塞或结束,则CPU当即进行切换。

2018-11-12

android_sqlserver_jdbc_jtds-1.2

Android 直接连接SqlServer数据库,jtds-1.2.jar,JTDS是一个开放源代码的100%纯Java的,用于JDBC 3.0驱动Microsoft SQL Server (6.5 ,7 ,2000和2005版本)和Sybase(10 ,11 ,12 ,15 版本)的驱动程序

2018-06-23

mysql-connector-java-5.1.17-bin.jar

mysql-connector-java-5.1.17-bin.jar.zip包是开发软件mysql中必备的一款jar程序包,在使用过程中可以配合着mysql的驱动完成快速程序编写

2018-06-23

sqlserver 2008 jdbc 驱动包

SQLServer2008 JDBC驱动包,可以用于解决Java连接SQLServer2008事物问题

2018-05-18

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

TA关注的人

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