Compare commits
2 Commits
91af52cf24
...
8b42b760e6
Author | SHA1 | Date | |
---|---|---|---|
8b42b760e6 | |||
51e80031ba |
7
pom.xml
7
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>
|
||||
|
@ -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
|
@ -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("数据库连接成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user