- 博客(4)
- 收藏
- 关注
原创 springboot java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)
报异常:java.sql.SQLException: Access denied for user ''@'localhost' (using password: NO)是database的配置写错了spring: datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://1...
2018-09-25 17:36:31 5618 5
原创 使用@Convert注解将List等不是基本数据类型的变量存入的数据库中
@Convert 可将不是基本数据类型的数据按照一定的格式转换成可存入数据库的基本类型,类似于自动拆装箱操作。 1、新建Converter类 2、实现javax.persistence.AttributeConverter包下的AttributeConverter接口 3、重写convertToDatabaseColumn()和convertToEntityAttribute() 4、在...
2018-09-13 00:15:30 4747 2
原创 springboot 配置logback 根据日志级别进行分级保存
1、在resources包下新建logback-spring.xml 文件logback-spring.xml2、logback-spring.xml<?xml version="1.0" encoding="utf-8" ?><configuration> <!-- ConsoleAppender
2018-09-11 01:07:25 1259
原创 Java 通过反射来获取对象的成员变量和其值的例子
/** * @author peter * 2018/9/4 19:04 */public class Reflect { private String name; private int age; private String cupSize; public Reflect(String name, int age, String cupSize) {...
2018-09-04 19:22:27 9274
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人