From 51e80031ba7d8a12844f6c1022c7cecfd0e6abcf Mon Sep 17 00:00:00 2001
From: NingHuan <2139614357@qq.com>
Date: Tue, 13 May 2025 10:47:23 +0800
Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]:=E4=BF=AE=E6=94=B9?=
 =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BB=A5=E5=8F=8Apom?=
 =?UTF-8?q?=E6=96=87=E4=BB=B6=E3=80=81test=E6=B5=8B=E8=AF=95=E7=B1=BB?=
 =?UTF-8?q?=E7=94=A8=E4=BA=8E=E6=95=B0=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5?=
 =?UTF-8?q?=EF=BC=8C[=E6=B7=BB=E5=8A=A0]:=E6=96=B0=E5=A2=9E=E6=95=B0?=
 =?UTF-8?q?=E6=8D=AE=E5=BA=93=E9=A9=B1=E5=8A=A8=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pom.xml                                           |  7 +++++++
 src/main/resources/application.properties         | 10 ++++++++++
 ...ationOrchestrationServiceApplicationTests.java | 15 +++++++++++++--
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index f469829..2e126ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -49,6 +49,13 @@
 			<artifactId>lombok</artifactId>
 			<optional>true</optional>
 		</dependency>
+
+		<!-- KingbaseES V8/V9 数据库 JDBC 驱动 -->
+		<dependency>
+			<groupId>com.kingbase8</groupId>
+			<artifactId>kingbase8</artifactId>
+			<version>9.0.0</version>
+		</dependency>
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
 			<artifactId>spring-boot-starter-test</artifactId>
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index d53e06e..c50d915 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -1 +1,11 @@
 spring.application.name=intelligent-application-orchestration-service
+
+
+# 数据库配置
+spring.datasource.url=jdbc:kingbase8://116.205.121.200:54321/Ipz
+spring.datasource.username=system
+spring.datasource.password=root
+spring.datasource.driver-class-name=com.kingbase8.Driver
+spring.datasource.hikari.maximum-pool-size=10
+spring.datasource.hikari.minimum-idle=5
+spring.datasource.hikari.connection-timeout=30000
\ No newline at end of file
diff --git a/src/test/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplicationTests.java b/src/test/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplicationTests.java
index ea39d17..ca59f9d 100644
--- a/src/test/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplicationTests.java
+++ b/src/test/java/com/bipt/intelligentapplicationorchestrationservice/IntelligentApplicationOrchestrationServiceApplicationTests.java
@@ -1,13 +1,24 @@
 package com.bipt.intelligentapplicationorchestrationservice;
 
 import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
+import javax.sql.DataSource;
+
+import java.sql.SQLException;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 @SpringBootTest
 class IntelligentApplicationOrchestrationServiceApplicationTests {
-
+	@Autowired
+	private DataSource dataSource;
 	@Test
-	void contextLoads() {
+	void contextLoads() throws SQLException {
+		// 尝试获取连接
+		assertNotNull(dataSource.getConnection(), "无法获取数据库连接!");
+		System.out.println("数据库连接成功!");
 	}
 
 }
-- 
2.25.1