From 29171503e276115401d0031010af979233543b78 Mon Sep 17 00:00:00 2001 From: xs Date: Fri, 27 Dec 2024 14:38:01 +0800 Subject: [PATCH] 1 --- .../dromara/common/mybatis/DriverTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/DriverTest.java diff --git a/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/DriverTest.java b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/DriverTest.java new file mode 100644 index 00000000..433a6a8a --- /dev/null +++ b/ruoyi-common/ruoyi-common-mybatis/src/main/java/org/dromara/common/mybatis/DriverTest.java @@ -0,0 +1,27 @@ +package org.dromara.common.mybatis; + +//import com.microsoft.sqlserver.jdbc.SQLServerDriver; +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; + + +public class DriverTest { + + public static void main(String[] args) { + try { +// com.microsoft.sqlserver.jdbc.SQLServerDriver s = new SQLServerDriver(); + Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } + + HikariConfig config = new HikariConfig(); + config.setJdbcUrl("jdbc:sqlserver://your-server:1433;databaseName=your-database"); + config.setUsername("your-username"); + config.setPassword("your-password"); + config.setDriverClassName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); + + HikariDataSource dataSource = new HikariDataSource(config); + // 使用 dataSource 进行数据库操作 + } +}