摘要: 传统处理Null方式 深层质疑 每次不确定一个变量是否为null时,添加一个进一步嵌套的if块,增加了代码缩进的层数。 public String getCarInsuranceName(Person person) { if (person != null) { Car car = person. 阅读全文
posted @ 2022-12-21 08:56 Lian_tiam 阅读(266) 评论(0) 推荐(0)
摘要: MySQL被设计为一个单进程多线程架构的数据库,数据库实例在系统上的表现就是一个进程。 当启动实例时,MySQL数据库会去读取配置文件,根据配置文件的参数来启动数据库实例。而在 MySQL 数据库中,可以没有配置文件,在这种情况下,MySQL会按照编译时的默认参数设置启动实例。 读取配置文件顺序: 阅读全文
posted @ 2022-12-16 10:26 Lian_tiam 阅读(21) 评论(0) 推荐(0)
摘要: 示例代码: package AbstractFactory.utils; import javax.xml.parsers.*; import org.w3c.dom.*; import java.io.*; public class XMLUtil { //该方法用于从XML配置文件中提取具体类类 阅读全文
posted @ 2022-12-13 10:43 Lian_tiam 阅读(53) 评论(0) 推荐(0)
摘要: nacos 依赖 mysql 先安装mysql ,这里使用的是8+版本,原因在于原本的 5.7 版本中并没有对 m1 的良好支持,如果启动会有报错说查询不到对应版本信息(虽然可以通过自定义 mirror 实现) mysql 配置参考(docker-compose): mysql: image: my 阅读全文
posted @ 2022-09-28 20:59 Lian_tiam 阅读(2668) 评论(0) 推荐(0)
摘要: 起因 部署web项目的时候并没有成功,说是资源不可访问,于是查找原因 1、首先检查了业务代码,看前端到controller有无问题 2、其次检查了项目的配置 3、后来发现在out输出里面并没有classes编译好的controller 4、回溯到module中发现build并没有产生target文件 阅读全文
posted @ 2021-03-09 12:34 Lian_tiam 阅读(1732) 评论(1) 推荐(0)
摘要: MySQL服务器启动失败的问题 在启动mysql服务的时候失败了 使用mysqld --console这个命令查看一下日志信息,查询到如下的报错情况: [ERROR] Can't start server: Invalid value for --default-authentication-plu 阅读全文
posted @ 2021-03-07 12:09 Lian_tiam 阅读(2282) 评论(0) 推荐(0)
摘要: 问题: Could not find resource com/xxx/xxx/StudentMapper.xml 原因: 没有导出xml文件,pom.xml文件配置有问题。也因为我的resource有多级的子目录,导致resource根目录的导出了,但是子目录下的都没有,其实就是没有匹配到子文件里 阅读全文
posted @ 2021-02-24 15:10 Lian_tiam 阅读(1016) 评论(0) 推荐(0)
摘要: package com.lian.lesson3; import com.lian.lesson2.utils.JDBCUtils; import java.sql.*; public class TestInsert { public static void main(String[] args) 阅读全文
posted @ 2021-02-19 17:25 Lian_tiam 阅读(2642) 评论(1) 推荐(0)
摘要: 使用注解实现AOP的时候遇见了一个问题 <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspe 阅读全文
posted @ 2021-02-10 13:03 Lian_tiam 阅读(460) 评论(0) 推荐(0)
摘要: 题目 The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, cal 阅读全文
posted @ 2021-01-23 15:18 Lian_tiam 阅读(111) 评论(0) 推荐(0)