This commit is contained in:
2023-06-30 18:58:54 +08:00
parent cdf203bb09
commit 7cee9fc8e9
22 changed files with 220 additions and 134 deletions

View File

@ -40,7 +40,12 @@ public enum DatasourceErrorCode {
/**
* 初始化数据错误
*/
INIT_DATA_ERROR(50406, "初始化数据错误");
INIT_DATA_ERROR(50406, "初始化数据错误"),
/**
* schema 不存在
*/
SCHEMA_NOT_EXIST_ERROR(50407, "SCHEMA: {} 不存在");
private final Integer code;
private final String msg;

View File

@ -26,14 +26,6 @@ public enum DataBaseEnum {
"com.mysql.cj.jdbc.Driver",
"SELECT 1"),
/**
* Oracle
*/
ORACLE("Oracle",
"jdbc:oracle:thin:@//{}:{}/{}",
"oracle.jdbc.OracleDriver",
"SELECT 1 from DUAL"),
/**
* PostgreSQL
*/

View File

@ -32,9 +32,6 @@ public class DatabaseUtil {
} else if (DataBaseEnum.POSTGRE_SQL.getType().equals(databaseType)) {
// (select position(',100,' in ',0,100,101,')) <> 0
return "(select position('," + var + ",' in ','||" + var2 + "||',')) <> 0";
} else if (DataBaseEnum.ORACLE.getType().equals(databaseType)) {
// instr(',0,100,101,' , ',100,') <> 0
return "instr(','||" + var2 + "||',' , '," + var + ",') <> 0";
}
// find_in_set(100 , '0,100,101')
return "find_in_set(" + var + " , " + var2 + ") <> 0";