摘要: 今天在deepseek上偶然问了这个问题,给出的描述很清楚,抄下来。 拦截器链执行核心 public class ReflectiveMethodInvocation implements MethodInvocation { private final Object target; private 阅读全文
posted @ 2025-11-05 08:03 shanxin1954 阅读(5) 评论(0) 推荐(0)
摘要: mBinding = MyDialog.inflate(LayoutInflater.from(getContext())); setContentView(R.layout.xxx); 类似上面两行,运行看似正常,但别处通过binding添加的点击listener之类不生效,一开始以为自定义dia 阅读全文
posted @ 2025-10-09 19:34 shanxin1954 阅读(3) 评论(0) 推荐(0)
摘要: 安卓9,usb连接之后,androidstudio会短暂的显示设备名,但几秒钟就掉了,变成no device found. which adb查看到adb位于/usr/bin/adb ls -lah /usr/bin/adb查看指向../lib/android-sdk/platform-tools/ 阅读全文
posted @ 2025-09-20 17:00 shanxin1954 阅读(6) 评论(0) 推荐(0)
摘要: > 这是一个非常好的问题,它触及了 Spring 框架中声明式事务管理(`@Transactional`)和底层资源管理(`JdbcTemplate`)如何协同工作的核心。 简单直接的回答是:**Spring 并不知道,也不关心你的方法内部使用的是哪个 `JdbcTemplate` 实例。它只关心当 阅读全文
posted @ 2025-09-18 10:49 shanxin1954 阅读(13) 评论(0) 推荐(0)
摘要: 一文彻底弄懂Spring Boot的启动过程 一,Spring Boot启动过程 1. 启动入口 Spring Boot 应用的启动入口通常是一个包含 @SpringBootApplication 注解的主类,并调用 SpringApplication.run() 方法。@SpringBootApp 阅读全文
posted @ 2025-09-15 19:43 shanxin1954 阅读(49) 评论(0) 推荐(0)
摘要: springboot在哪里写自己的代码。 @SpringBootApplication public class FooApplication { public static void main(String[] args) { SpringApplication.run(FooApplicatio 阅读全文
posted @ 2025-09-15 19:41 shanxin1954 阅读(4) 评论(0) 推荐(0)
摘要: 试着基于jdbctemplate包装一个MysqlHelper类。连接池采用springboot默认的hikari。jdbctemplate提供基本的防注入,它的写法比jdbc好看,jdbc还需要putint,putstr。提供的另一个功能是结果集的转换。写完,测试代码的面貌如下: var sqlh 阅读全文
posted @ 2025-09-15 18:23 shanxin1954 阅读(7) 评论(0) 推荐(0)
摘要: 用jdbc操作mysqlhttps://www.runoob.com/java/java-mysql-connect.htmlmysql8之前和之后的连接配置有差异。实际使用时,一般还需要个功能,就是连接池。这个springboot自带了,是hikari。hikari初始化的时候,也需要配置mysq 阅读全文
posted @ 2025-09-14 23:29 shanxin1954 阅读(4) 评论(0) 推荐(0)
摘要: https://www.baeldung-cn.com/spring-boot-hikari 概述 Hikari 一是个JDBC数据源连接池。与其它连接池相比,它更轻量级且性能更优。 本快速教程将展示如何在基于 Spring Boot 3 的应用程序中配置 Hikari 数据源。 2. 在 Spri 阅读全文
posted @ 2025-09-14 22:29 shanxin1954 阅读(84) 评论(0) 推荐(0)
摘要: jdbc的metadata有gettables和gettablecolumns方法,只是这两个方法用起来需要小心设置参数。 获取所有用户表: var metaData = conn.getMetaData(); var itbl = metaData.getTables(conn.getCatlog 阅读全文
posted @ 2025-03-13 09:50 shanxin1954 阅读(124) 评论(0) 推荐(0)