mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add dbtype AlibabaOracle
This commit is contained in:
@@ -42,18 +42,19 @@ import com.alibaba.druid.support.logging.LogFactory;
|
||||
import com.alibaba.druid.util.JdbcUtils;
|
||||
|
||||
public class SQLUtils {
|
||||
|
||||
private final static Log LOG = LogFactory.getLog(SQLUtils.class);
|
||||
|
||||
public static String toSQLString(SQLObject sqlObject, String dbType) {
|
||||
if (JdbcUtils.MYSQL.equals(dbType)) {
|
||||
return toMySqlString(sqlObject);
|
||||
}
|
||||
|
||||
|
||||
if (JdbcUtils.H2.equals(dbType)) {
|
||||
return toMySqlString(sqlObject);
|
||||
}
|
||||
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
return toOracleString(sqlObject);
|
||||
}
|
||||
|
||||
@@ -163,7 +164,7 @@ public class SQLUtils {
|
||||
|
||||
public static SQLASTOutputVisitor createFormatOutputVisitor(Appendable out, List<SQLStatement> statementList,
|
||||
String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
if (statementList.size() == 1) {
|
||||
return new OracleOutputVisitor(out, false);
|
||||
} else {
|
||||
@@ -191,7 +192,7 @@ public class SQLUtils {
|
||||
}
|
||||
|
||||
public static SchemaStatVisitor createSchemaStatVisitor(List<SQLStatement> statementList, String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
if (statementList.size() == 1) {
|
||||
return new OracleSchemaStatVisitor();
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.alibaba.druid.util.JdbcUtils;
|
||||
public class SQLParserUtils {
|
||||
|
||||
public static SQLStatementParser createSQLStatementParser(String sql, String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
return new OracleStatementParser(sql);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SQLParserUtils {
|
||||
if (JdbcUtils.SQL_SERVER.equals(dbType)) {
|
||||
return new SQLServerStatementParser(sql);
|
||||
}
|
||||
|
||||
|
||||
if (JdbcUtils.H2.equals(dbType)) {
|
||||
return new MySqlStatementParser(sql);
|
||||
}
|
||||
@@ -52,14 +52,14 @@ public class SQLParserUtils {
|
||||
}
|
||||
|
||||
public static SQLExprParser createExprParser(String sql, String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
return new OracleExprParser(sql);
|
||||
}
|
||||
|
||||
if (JdbcUtils.H2.equals(dbType)) {
|
||||
return new MySqlExprParser(sql);
|
||||
}
|
||||
|
||||
|
||||
if (JdbcUtils.MYSQL.equals(dbType)) {
|
||||
return new MySqlExprParser(sql);
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ public class ParameterizedOutputVisitorUtils {
|
||||
}
|
||||
|
||||
public static SQLASTOutputVisitor createParameterizedOutputVisitor(Appendable out, String dbType) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
return new OracleParameterizedOutputVisitor(out);
|
||||
}
|
||||
|
||||
if (JdbcUtils.MYSQL.equals(dbType)) {
|
||||
return new MySqlParameterizedOutputVisitor(out);
|
||||
}
|
||||
|
||||
|
||||
if (JdbcUtils.H2.equals(dbType)) {
|
||||
return new MySqlParameterizedOutputVisitor(out);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SQLEvalVisitorUtils {
|
||||
return new MySqlEvalVisitorImpl();
|
||||
}
|
||||
|
||||
if (JdbcUtils.ORACLE.equals(dbType)) {
|
||||
if (JdbcUtils.ORACLE.equals(dbType) || JdbcUtils.ALI_ORACLE.equals(dbType)) {
|
||||
return new OracleEvalVisitor();
|
||||
}
|
||||
|
||||
@@ -623,11 +623,11 @@ public class SQLEvalVisitorUtils {
|
||||
if (a instanceof BigInteger || b instanceof BigInteger) {
|
||||
return _bigInt(a).add(_bigInt(b));
|
||||
}
|
||||
|
||||
|
||||
if (a instanceof Double || b instanceof Double) {
|
||||
return _double(a) + _double(b);
|
||||
}
|
||||
|
||||
|
||||
if (a instanceof Float || b instanceof Float) {
|
||||
return _float(a) + _float(b);
|
||||
}
|
||||
@@ -671,11 +671,11 @@ public class SQLEvalVisitorUtils {
|
||||
if (a instanceof BigInteger || b instanceof BigInteger) {
|
||||
return _bigInt(a).subtract(_bigInt(b));
|
||||
}
|
||||
|
||||
|
||||
if (a instanceof Double || b instanceof Double) {
|
||||
return _double(a) - _double(b);
|
||||
}
|
||||
|
||||
|
||||
if (a instanceof Float || b instanceof Float) {
|
||||
return _float(a) - _float(b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user