Skip to content

Commit

Permalink
支持mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
qaiu committed Jun 6, 2024
1 parent 7663320 commit b0b8b61
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core-database/src/main/java/cn/qaiu/db/pool/JDBCType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cn.qaiu.db.pool;

/**
* @author <a href="https://qaiu.top">QAIU</a>
* @date 2023/10/10 14:06
*/
public enum JDBCType {
MySQL, H2DB
}
18 changes: 18 additions & 0 deletions core-database/src/main/java/cn/qaiu/db/pool/JDBCUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cn.qaiu.db.pool;

/**
* @author <a href="https://qaiu.top">QAIU</a>
* @date 2023/10/10 14:05
*/
public class JDBCUtil {
public static JDBCType getJDBCType(String deviceName) {
switch (deviceName) {
case "com.mysql.cj.jdbc.Driver":
case "com.mysql.jdbc.Driver":
return JDBCType.MySQL;
case "org.h2.Driver":
return JDBCType.H2DB;
}
throw new RuntimeException("不支持的SQL驱动类型: " + deviceName);
}
}

0 comments on commit b0b8b61

Please sign in to comment.