- 博客(10)
- 收藏
- 关注
原创 mysql一列一行转一列多行
效果实现SELECT DISTINCT SUBSTRING_INDEX( SUBSTRING_INDEX( a.path, ',', b.help_topic_id + 1 ), ',',- 1 ) AS path FROM ( SELECT '1,2,3,4,5,6,7,8' AS path FROM DUAL ) a JOIN mysql.help_topic b ON b.help_topic_id < ( LENGTH( a.path ) - LENGTH( REPLACE (
2022-01-18 17:15:22 567
原创 Length Required:HTTP Error 411. The request must be chunked or have a content length.
最近在使用curl调用POST接口时,报http 411错误原请求方式:curl http://localhost:8080/test -X POST报错信息:HTTP Error 411. The request must be chunked or have a content length.修改后的请求方式:curl http://localhost:8080/test -X POST –header "Content-Length: 0"在加上 –header “Conten
2021-11-05 16:41:13 4688
原创 RSA分段加解密
package demo;import org.apache.commons.codec.binary.Base64;import javax.crypto.Cipher;import java.security.*;import java.security.interfaces.RSAPrivateKey;import java.security.interfaces.RSAPub...
2020-04-08 14:39:03 360
原创 Windows下pgsql口令认证失败psql: FATAL: password authentication failed for user "Administrator"
当我们使用psql命令时,如果不加-U参数,默认使用的用户名是我们本地电脑登录的管理员用户名而在postgresql库中并没有存这个用户,所以报错因此我们应该使用psql -U postgres再根据提示输入密码就可以了...
2020-03-13 09:31:08 2111
原创 @Scheduled注解不执行
1.在定时方法的类上加@EnableScheduling注解2.在spring的配置文件里加上<task:annotation-driven />配置文件头部的必须要有:xmlns:task="http://www.springframework.org/schema/task"xsi:schemaLocation=" http://www.springframework...
2020-03-11 19:08:02 2298
原创 window安装postgresql 报" Failed to load sql modules into the database cluster"
1.出现这个错误的原因可能是因为使用的是Administrator用户安装的,我们可以试着创建一个postgres用户,可参照 https://www.ithome.com/html/win10/237491.htm2.然后创建一个文件夹D://postgres用来存放postgresql-10.12-1-windows.exe安装包,再在D://postgres文件夹下创建名为10的文件夹(我...
2020-03-09 18:11:37 1366 2
原创 Spring集成Redis
1.redis所需jar包依赖<dependency> <groupId>redis.clients</groupId> <artifactId>jedis</artifactId> <version>2.9.0</version></dependency><dependency>...
2020-03-09 16:45:29 131
原创 使用AbstractRoutingDataSource和aop动态切换数据源
1.先写一个DataSourceContextHolder类public class DataSourceContextHolder { private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>(); //设置数据源 public stati...
2020-02-28 14:30:07 233
原创 JavaWeb常用基本配置文件
1.web.xml<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation=...
2020-02-28 11:16:57 292
原创 JavaWeb中乱码问题
1.请求乱码在web.xml中配置过滤器 <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filt...
2020-02-27 19:11:01 85
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人