e-凯发k8国际

`
文章列表
错误信息:   org.springframework.dao.cannotacquirelockexception: ### error updating database. cause: com.mysql.cj.jdbc.exceptions.mysqltransactionrollbackexception: lockwaittimeoutexceeded; try restarting transaction   原因:表的某条记录更增操作可能在另外一个大的事务里被锁,锁的时间超过了数据库指定时间(如下图:innodb_lock_wait_timeout=10秒),导致此处 ...
unsupported conversion from date to java.lang.long   正解:date类型换成localdatetime 误解:去掉@builder标签

统计代码行数

    博客分类:
  • java
import lombok.extern.slf4j.slf4j; import org.junit.test; import org.junit.runner.runwith; import org.springframework.boot.test.context.springboottest; import org.springframework.test.context.junit4.springrunner;   import java.io.bufferedreader; import java.io.file; import java.io.filereader; ...
# 配置sql打印日志 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.stdoutimpl logging: level: root: info com.***.telemarket.mapper: trace 引入jar包并配置resources下的logback-spring.xml文件如下
@springboottest(classes = telemarketcoreapplication.class) @runwith(springrunner.class) @activeprofiles("test") public class couponsinfoservicetest { @mockbean resttemplate resttemplate; @autowired private couponsinfoservice couponsinfoservice; @before public void setup() { ...

读excel文件生成sql

    博客分类:
  • java
import java.io.*; import java.util.arraylist; import java.util.list; public class stringtoolsqlformatter { private static final string sql_1 = "update t_call_data set decision_complete_type='batch_decision_compilte' where register_id=%s and date_format(import_time,'%y-%m-%e')=" ...

rabbitmq 使用

    博客分类:
  • java
api模块接收请求,推送到消息队列 router模块消费消息,分发到各个模块 每个模块消费消息,在推回api模块,因为api模块需要知道最终执行结果     api模块配置: spring:   cloud:     stream:       bindings:         outbound-agent-state-list.destination: outbound.agent-state-list   #生产         agent-state-list-reply-channel:                                    # ...
    博客分类:
  • java
  一、定义注解 package com.yare.annotation; import java.lang.annotation.*; /** * @author : zhangyan 2018/9/19 * 日志注解 */ @retention(retentionpolicy.runtime) @target({elementtype.method}) @inherited @documented public @interface log { string logstr() default ""; }   2.定义切面 ...
    博客分类:
  • java
public string combineallfields(string split) { final field[] fields = this.getclass().getdeclaredfields(); if (fields.length < 1) { return null; } stringbuffer result = new stringbuffer(); for (int i = 0; i < fields.length; i ) { char[] cs = fields[i].g ...
    博客分类:
  • java
一、表设计: drop table if exists `ma_quartz_info`; create table `ma_quartz_info` (   `id` bigint(20) not null auto_increment comment '主键',   `name` varchar(32) default '' comment '定时任务名称',   `code` varchar(64) default '' comment '定时任务code标识',   `cycle` varchar(32) default '' comment '定时任务执行周期',   ...
    博客分类:
  • java
遍历删除list中的元素有很多种方法,当运用不当的时候就会产生问题。下面主要看看以下几种遍历删除list中元素的形式: 1.通过增强的for循环删除符合条件的多个元素 2.通过增强的for循环删除符合条件的一个元素 3.通过普通的for删除删除符合条件的多个元素 4.通过iterator进行遍历删除符合条件的多个元素   /**    * 使用增强的for循环  
    博客分类:
  • java
/**  * created by zhangyan on 2017/8/31.  */ public class iptool {       private static final logger log = logger.getlogger(iptool.class);       public static string getlocalinet4address() throws baseexception{         try {             enumeration allnetinterfaces = networkinterface.getnet ...
    博客分类:
  • java
whale_alarm src/main/java src/main/resources ${project.bui ...
    public static void main(string[] args) throws exception {         executorservice es = executors.newfixedthreadpool(300);           callable
网站地图