问题:time类型数据插入不进mysql数据库:调试的时候报如下错误: Caused by: java.lang.NumberFormatException: For input string: "13:02:19" Resolving exception from handler [public slc.utils.ResultJson slc.controller.SamplingpointinfoController.saveSamplingpointinfo(java.lang…
1.问题描述 在使用redis时,配置自定义序列化redisTemplate为FastJsonRedisSerializer .  1 /** 2 * 自定义redis序列化器 3 */ 4 @SuppressWarnings("unchecked") 5 @Bean("redisTemplate") 6 public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory f…
1.commons-beanutils的使用 commons-beanutils-1.9.3.jar 依赖 commons-logging-1.2.jar 代码1: String className = "cn.itcast.domain.Person"; Class clazz = Class.forName(className); Object bean = clazz.newInstance(); BeanUtils.setProperty(bean, "name&qu…
将字符串类型的时间转换成date类型可以使用SimpleDateFormat来转换,具体方法如下:1.定义一个字符串类型的时间:2.创建一个SimpleDateFormat对象并设置格式:3.最后使用SimpleDateFormat的parse方法将String类型的时间转换成Date类型的时间.具体代码如下: String string = "2014-3-17"; SimpleDateFormat dateFormat = new SimpleDateFormat("yy…
Mysql一个非常有用的内置函数 今天碰到要把MySQL数据库中的varchar转换成date类型进行时间的比较和查询.在网上找了找,发现MySQL也跟其他数据库一样有自己内置的转换函数:str_to_date(params,convert). 例子: 比如数据库中的varchar为2013-08-05 10:10:10 00:00+8:00 转换YYYY-mm-dd:str_to_date('2013-08-05 10:10:10 00:00+8:00','%Y-%m-%d ') 转换YYYY…
第一篇文章: 相信大家做过JSON相关的东西对这个异常并不陌生,这个异常是由于JSONObject插件内部会无限拆解你传入的对象,直到没有可拆解为止,问题就在这,如果你传入的对象有外键关系,或者相互引用,那么内部就会死循环,也就会抛出这个异常 解决办法,我们先说一种网上通用的:过滤      不错,过滤肯定会解决该问题,过滤也有两种方法: 一种是通过 jsonConfig.setExcludes(new String[]{"dianYuanHeSuans"}) 该方法接受一个数组,也就…
不多说,直接上干货! package zhouls.bigdata.DataFeatureSelection.sim; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class GetIntervalDays { public static void main(String[] args) throws ParseException { Strin…
The server encountered an internal error that prevented it from fulfilling this request.org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: failed to lazily initialize a collection of role: com.party.dinner.entit…
从前台接收json封装的list数据,在后台接收时一直报错,com.alibaba.fastjson.JSONObject cannot be cast to xxx, 使用这种方式接收可以接收 @RequestMapping(value = "/insertUser", method = RequestMethod.POST) public ResultT insertUser(@RequestBody Map<String,List<User>> map){…
::-exec-] DEBUG c.i.e.m.I.insertDataEmebeding - <== Updates: ::-exec-] ERROR c.i.e.c.CaseArchiveController - -----------导出数据失败------------ com.alibaba.fastjson.JSONException: illegal identifier : \ at com.alibaba.fastjson.parser.JSONLexerBase.scanSym…