Zero date value prohibited
发表于|更新于
|浏览量:
世界上最大的谎言就是你不行。——《垫底辣妹》
报Zero date value prohibited错的时候
在连接mysql的URL上加入&zeroDateTimeBehavior=convertToNull即可
原因是因为我们存入数据库中的date类型字段有为0的数据
加了此参数,即可让mysql处理的时候,把为0的日期当作null处理
相关推荐
2021-02-28
quartz指定时间点触发
国家用人,当以德为本,才艺为末。——康熙 之前写过一篇Quartz的博客 今天做一点补充 如果我们需要指定时间点触发任务,则可以使用 123// 指定时间点触发Date executeDate = new Date(System.currentTimeMillis() + 5000);TriggerBuilder.newTrigger().startAt(executeDate).withIdentity("achao", "ruben").build(); 这样去构建 这样,我们的任务就会在指定的时间点触发
2021-06-12
parallelStream
我又愿中国青年只是向上走,不必理会这冷笑和暗箭。——鲁迅 我们在开发中经常使用stream去处理我们的集合 这里分享一个并行流:parallelStream 它可以允许我们的声明式编程以多线程并行的方式执行 首先我们可以比较一下性能 1234567891011121314List<Integer> list = new SecureRandom().ints().limit(10000000).boxed().collect(Collectors.toList());long startTime = System.nanoTime();// 求和操作int sum = list.stream().mapToInt(Integer::intValue).reduce(0, Integer::sum);System.out.println("普通stream求和结果:" + sum);long normalStreamEndTime = System.nanoTime();System.out.println("普通stream耗时:&q...
2024-03-06
javadoc保留格式标签
不结果的树是没人去摇的。唯有那些果实累累的,才有人用石子去打。——罗曼·罗兰 在hutool中就有体现: 12345678910111213141516171819202122232425262728293031323334353637383940414243/* * Copyright (c) 2023 looly(loolly@aliyun.com) * Hutool is licensed under Mulan PSL v2. * You can use this software according to the terms and conditions of the Mulan PSL v2. * You may obtain a copy of Mulan PSL v2 at: * https://license.coscl.org.cn/MulanPSL2 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * E...
2023-03-13
spring-guides-accessing-data-jpa
名誉过高,实在是一种害人的负担——福尔特尔 教程网址:https://spring.io/guides/gs/accessing-data-jpa 首先访问 [pre-initialized project](https://start.spring.io/#!type=maven-project&language=java&platformVersion=3.0.1&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=accessing-data-jpa&name=accessing-data-jpa&description=Demo project for Spring Boot&packageName=com.example.accessing-data-jpa&dependencies=data-jpa,h2) 直接点击GENERATE 下载下来,解压并打开项目 首先新建一个Customer类 12...
2022-07-09
Collectors.flatMapping
我只想站在比你高的地方,用人类最纯粹的痛苦和烦恼给你一记响亮的耳光。——《阴火》 发现官方竟然没有,那就自己写一个 12345678910public static <T, U, A, R>Collector<T, ?, R> flatMapping(Function<? super T, Stream<? extends U>> mapper, Collector<? super U, A, R> downstream) { BiConsumer<A, ? super U> downstreamAccumulator = downstream.accumulator(); return new Collectors.CollectorImpl<>(downstream.supplier(), (r, t) -> Opp.ofNullable(t).map(mapper).ifPres...
2023-02-07
mp查询出来时间自动去掉秒
陷入经济困境的人,是最容易被利用的——加藤谛三 由于需求变动,原先存入为LocalDateTime的,现在需要精确到分,但保留数据库原有的数据 所以查询时,只精确到分,将秒去掉 我们使用typeHandler,将秒设置为00 首先添加@TableName(autoResultMap = true)然后添加@TableField(typeHandler = DeSecondHandler.class) 12345678910111213141516171819202122232425package com.ruben.simplestreamquery.pojo.po;import com.baomidou.mybatisplus.annotation.TableField;import com.baomidou.mybatisplus.annotation.TableName;import com.ruben.simplestreamquery.handler.DeSecondsHandler;import lombok.Data;import java.time.Local...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog