OCT REM: 1. 修复代码检测问题

This commit is contained in:
HuangXin 2025-02-27 14:46:12 +08:00
parent 063b73c3de
commit 9638f92990
1 changed files with 9 additions and 7 deletions

View File

@ -46,13 +46,15 @@ public class H2DataBaseConfig {
@Bean
public CommandLineRunner startH2DatabaseServer() {
return args -> {
// 启动 H2 数据库 TCP 服务器
Server.createTcpServer("-tcp", "-tcpPort", String.valueOf(tcpPort), "-tcpAllowOthers").start();
// 生成远程连接 URL
String remoteBase = "jdbc:h2:tcp://" + CommonConfigure.LOCAL_IP_ADDR + ":" + tcpPort;
String connStr = connectString.replace("jdbc:h2:file:", remoteBase);
// 记录远程连接 URL 到日志
log.info("H2 Database server remote connect url [{}]", connStr);
if (commonConfigure != null) {
// 启动 H2 数据库 TCP 服务器
Server.createTcpServer("-tcp", "-tcpPort", String.valueOf(tcpPort), "-tcpAllowOthers").start();
// 生成远程连接 URL
String remoteBase = "jdbc:h2:tcp://" + CommonConfigure.LOCAL_IP_ADDR + ":" + tcpPort;
String connStr = connectString.replace("jdbc:h2:file:", remoteBase);
// 记录远程连接 URL 到日志
log.info("H2 Database server remote connect url [{}]", connStr);
}
};
}
}