-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |