随笔分类 -  JAVA

上一页 1 2
mysql数据库中插入表情符号
摘要:手机端插入Emoji表情,保存到数据库时报错: Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x84' for column 'review' at row 1 at com.mysql.jdbc.SQ 阅读全文
posted @ 2019-09-29 14:42 韩坨麟 阅读(3191) 评论(0) 推荐(0)
BeanUtils.copyProperties(待复制对象, 待更新对象) || PropertyUtils.copyProperties(待更新对象, 待复制对象)
摘要:用法总结如下: BeanUtils.copyProperties("转换后的类", "要转换的类"); PropertyUtils.copyProperties("转换后的类", "要转换的类"); 用法其实很简单,第一个参数是转换后的类,第二个参数是待转换的类 重写: ReflectASM,高性能 阅读全文
posted @ 2019-09-06 11:20 韩坨麟 阅读(340) 评论(0) 推荐(0)
ThreadLocal
摘要:import java.util.Random; /** * ThreadLocal类及应用技巧 * ******************************************************************* * 每个线程调用全局ThreadLocal对象的set方法,就 阅读全文
posted @ 2019-08-26 17:38 韩坨麟 阅读(156) 评论(0) 推荐(0)
synchronized 锁
摘要:1. synchronized 的用处 ​ 在学习操作系统的时候,我们会经常听到死锁,互斥量等名词,我们知道这是在多个线程访问一些有限的资源而造成的。同样,在java多线程编程的时候,往往这些线程都会在某个时机访问相同的资源,这里的资源我们可以具体到一个变量,一个对象,一段代码块,甚至一个类。那么如 阅读全文
posted @ 2019-08-16 09:52 韩坨麟 阅读(172) 评论(0) 推荐(0)
STS报could not find tools.jar in the active JRE
摘要:STS报could not find tools.jar in the active JRE STS报could not find tools.jar in the active JRE STS报could not find tools.jar in the active JRE STS报could 阅读全文
posted @ 2019-08-14 13:55 韩坨麟 阅读(3440) 评论(0) 推荐(0)
SpringBoot 定时任务 || cron表达式
摘要:定时任务实现的几种方式: Timer:这是java自带的java.util.Timer类,这个类允许你调度一个java.util.TimerTask任务。使用这种方式可以让你的程序按照某一个频度执行,但不能在指定时间运行。一般用的较少。 ScheduledExecutorService:也jdk自带 阅读全文
posted @ 2019-08-02 14:41 韩坨麟 阅读(22721) 评论(0) 推荐(2)
lombok注解
摘要:Lomboz是一个基于LGPL的开源J2EE综合开发环境的Eclipse插件,对编码,发布,测试,以及debug等各个软件开发的生命周期提供支持,支持JSP,EJB等。Lomboz是Eclipse的一个J2EE的插件,它将很多Java应用服务器、J2EE组件和Web应用开发集成到Eclipse中,可 阅读全文
posted @ 2019-08-02 14:17 韩坨麟 阅读(322) 评论(0) 推荐(0)
cron表达式
摘要:Cron表达式是一个字符串,字符串以5或6个空格隔开,分为6或7个域,每一个域代表一个含义,Cron有如下两种语法格式: (1) Seconds Minutes Hours DayofMonth Month DayofWeek Year (2)Seconds Minutes Hours DayofM 阅读全文
posted @ 2019-08-02 14:05 韩坨麟 阅读(140) 评论(0) 推荐(0)
IntelliJ Idea 常用快捷键列表
摘要:1. 自动代码 常用的有fori/sout/psvm+Tab即可生成循环、System.out、main方法等boilerplate样板代码 例如要输入for(User user : users)只需输入user.for+Tab 再比如,要输入Date birthday = user.getBirt 阅读全文
posted @ 2019-03-19 10:21 韩坨麟 阅读(1440) 评论(0) 推荐(0)
Java使用POI实现数据导出excel报表
摘要:Java使用POI实现数据导出excel报表 博客分类: Java Java使用POI实现数据导出excel报表 Java 阅读更多 在上篇文章中,我们简单介绍了java读取word,excel和pdf文档内容 ,但在实际开发中,我们用到最多的是把数据库中数据导出excel报表形式。不仅仅简单的读取 阅读全文
posted @ 2019-02-19 10:22 韩坨麟 阅读(4314) 评论(0) 推荐(0)
日期12小时 || 24小时制切换
摘要:SimpleDateFormat 12小时制和24小时制的区别是大写为24小时制,小写为12小时制。 使用SimpleDateFormat时格式化时间的 yyyy.MM.dd 为年月日; 如果希望格式化时间为12小时制的,则使用hh:mm:ss; 而如果希望格式化时间为24小时制的,则使用HH:mm 阅读全文
posted @ 2019-02-19 10:08 韩坨麟 阅读(481) 评论(0) 推荐(0)
BigDecimal 相除时因除不尽报错
摘要:BigDecimal sdd = new BigDecimal(2415.4728).divide(new BigDecimal(9661.8910), 4).setScale(4, BigDecimal.ROUND_HALF_DOWN);System.out.println(sdd); 阅读全文
posted @ 2019-02-12 19:57 韩坨麟 阅读(1390) 评论(0) 推荐(0)
Spring Boot 构建项目时报错:You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugi
摘要:Spring Boot 利用插件构造QueryDSL语句时报错:You need to run build with JDK or have tools.jar on the classpath.If this occur.... You need to run build with JDK or 阅读全文
posted @ 2019-02-12 19:51 韩坨麟 阅读(710) 评论(0) 推荐(0)
JSON注解
摘要:jackson的maven依赖 pom文件中的引用: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.4.0</version> < 阅读全文
posted @ 2018-02-02 10:34 韩坨麟 阅读(4746) 评论(0) 推荐(0)
常用正则表达式
摘要://支持小数及0的金额,小数最多二位 String enumber = "^(([1-9][0-9]*|0)|(([1-9][0-9]*|0)\\.\\d{1,2}))$";//支持0的正整数 String number = "^([1-9][0-9]*|0)$";//数字 String dnumb 阅读全文
posted @ 2018-01-09 11:38 韩坨麟 阅读(129) 评论(0) 推荐(0)
java//jsp 去掉首尾空格
摘要:java: String value = val.trim(); js: var remarks = $("#remarks").val().replace(/(^\s*)|(\s*$)/g,""); 举例: js: function doSubModify(){ var modify_adjBro 阅读全文
posted @ 2018-01-08 14:03 韩坨麟 阅读(1252) 评论(0) 推荐(0)

上一页 1 2