本文整理汇总了Java中com.alibaba.druid.sql.parser.SQLParserUtils类的典型用法代码示例。如果您正苦于以下问题:Java SQLParserUtils类的具体用法?Java SQLParserUtils怎么用?Java SQLParserUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLParserUtils类属于com.alibaba.druid.sql.parser包,在下文中一共展示了SQLParserUtils类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: oracleValidationQueryCheck
import com.alibaba.druid.sql.parser.SQLParserUtils; //导入依赖的package包/类
private void oracleValidationQueryCheck() {
if (validationQuery == null) {
return;
}
if (validationQuery.length() == 0) {
return;
}
SQLStatementParser sqlStmtParser = SQLParserUtils.createSQLStatementParser(validationQuery, this.dbType);
List<SQLStatement> stmtList = sqlStmtParser.parseStatementList();
if (stmtList.size() != 1) {
return;
}
SQLStatement stmt = stmtList.get(0);
if (!(stmt instanceof SQLSelectStatement)) {
return;
}
SQLSelectQuery query = ((SQLSelectStatement) stmt).getSelect().getQuery();
if (query instanceof SQLSelectQueryBlock) {
if (((SQLSelectQueryBlock) query).getFrom() == null) {
LOG.error("invalid oracle validationQuery. " + validationQuery + ", may should be : " + validationQuery
+ " FROM DUAL");
}
}
}
开发者ID:mazhou,项目名称:es-sql,代码行数:29,代码来源:ElasticSearchDruidDataSource.java
示例2: db2ValidationQueryCheck
import com.alibaba.druid.sql.parser.SQLParserUtils; //导入依赖的package包/类
private void db2ValidationQueryCheck() {
if (validationQuery == null) {
return;
}
if (validationQuery.length() == 0) {
return;
}
SQLStatementParser sqlStmtParser = SQLParserUtils.createSQLStatementParser(validationQuery, this.dbType);
List<SQLStatement> stmtList = sqlStmtParser.parseStatementList();
if (stmtList.size() != 1) {
return;
}
SQLStatement stmt = stmtList.get(0);
if (!(stmt instanceof SQLSelectStatement)) {
return;
}
SQLSelectQuery query = ((SQLSelectStatement) stmt).getSelect().getQuery();
if (query instanceof SQLSelectQueryBlock) {
if (((SQLSelectQueryBlock) query).getFrom() == null) {
LOG.error("invalid db2 validationQuery. " + validationQuery + ", may should be : " + validationQuery
+ " FROM SYSDUMMY");
}
}
}
开发者ID:mazhou,项目名称:es-sql,代码行数:29,代码来源:ElasticSearchDruidDataSource.java
示例3: parseStmt
import com.alibaba.druid.sql.parser.SQLParserUtils; //导入依赖的package包/类
private SQLStatement parseStmt(String sql) {
SQLStatementParser statParser = SQLParserUtils.createSQLStatementParser(sql, "mysql");
SQLStatement stmt = statParser.parseStatement();
return stmt;
}
开发者ID:huang-up,项目名称:mycat-src-1.6.1-RELEASE,代码行数:6,代码来源:TableStatAnalyzer.java
示例4: sqlValid
import com.alibaba.druid.sql.parser.SQLParserUtils; //导入依赖的package包/类
public static void sqlValid(String sql, DataBaseType dataBaseType){
SQLStatementParser statementParser = SQLParserUtils.createSQLStatementParser(sql,dataBaseType.getTypeName());
statementParser.parseStatementList();
}
开发者ID:yaogdu,项目名称:datax,代码行数:5,代码来源:DBUtil.java
示例5: parseStmt
import com.alibaba.druid.sql.parser.SQLParserUtils; //导入依赖的package包/类
private SQLStatement parseStmt(String sql) {
SQLStatementParser statParser = SQLParserUtils.createSQLStatementParser(sql, "mysql");
SQLStatement stmt = statParser.parseStatement();
return stmt;
}
开发者ID:actiontech,项目名称:dble,代码行数:6,代码来源:TableStatAnalyzer.java
注:本文中的com.alibaba.druid.sql.parser.SQLParserUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论