Package com.taobao.tddl.interact.rule.bean

Examples of com.taobao.tddl.interact.rule.bean.SqlType


  public boolean execute() throws SQLException {
    if (log.isDebugEnabled()) {
      log.debug("invoke execute, sql = " + sql);
    }

    SqlType sqlType = SQLParser.getSqlType(sql);
    if (sqlType == SqlType.SELECT || sqlType == SqlType.SELECT_FOR_UPDATE || sqlType == SqlType.SHOW) {
      executeQuery();
      return true;
    } else if (sqlType == SqlType.INSERT || sqlType == SqlType.UPDATE || sqlType == SqlType.DELETE||sqlType == SqlType.REPLACE
        ||sqlType==SqlType.TRUNCATE|| sqlType == SqlType.CREATE|| sqlType== SqlType.DROP|| sqlType == SqlType.LOAD|| sqlType== SqlType.MERGE) {
View Full Code Here


   */
  public static SqlType getSqlType(String sql) throws SQLException {
    //#bug 2011-11-24,modify by junyu,�Ȳ��߻��棬����sql�仯�޴󣬻��滻�뻻��̫�࣬gc̫����
//    SqlType sqlType = globalCache.getSqlType(sql);
//    if (sqlType == null) {
    SqlType sqlType=null;
    //#bug 2011-12-8,modify by junyu ,this code use huge cpu resource,and most
    //sql have no comment,so first simple look for there whether have the comment
    String noCommentsSql=sql;
    if(sql.contains("/*")){
      noCommentsSql = StringUtils.stripComments(sql, "'\"", "'\"", true, false, true, true).trim();
View Full Code Here

  //jdbc�淶: ����true��ʾexecuteQuery��false��ʾexecuteUpdate
  private boolean executeInternal(String sql, int autoGeneratedKeys, int[] columnIndexes, String[] columnNames)
      throws SQLException {

    SqlType sqlType = SQLParser.getSqlType(sql);
    if (sqlType == SqlType.SELECT || sqlType == SqlType.SELECT_FOR_UPDATE || sqlType == SqlType.SHOW) {
      executeQuery(sql);
      return true;
    } else if (sqlType == SqlType.INSERT || sqlType == SqlType.UPDATE || sqlType == SqlType.DELETE||sqlType == SqlType.REPLACE||sqlType == SqlType.TRUNCATE
        || sqlType == SqlType.CREATE|| sqlType== SqlType.DROP|| sqlType == SqlType.LOAD|| sqlType== SqlType.MERGE) {
View Full Code Here

TOP

Related Classes of com.taobao.tddl.interact.rule.bean.SqlType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.