Package net.sourceforge.squirrel_sql.fw.sql

Examples of net.sourceforge.squirrel_sql.fw.sql.QueryTokenizer


        if (tokenizer == null || !customTokenizerInstalled) {
            // No tokenizer has been set by any installed plugin.  Go ahead and
            // give the default tokenizer.  It is important to not cache this
            // object so that session property changes to the current session
            // are reflected in this default tokenizer.
            tokenizer = new QueryTokenizer(_props.getSQLStatementSeparator(),
                                           _props.getStartOfLineComment(),
                                           _props.getRemoveMultiLineComment());
        }
        return tokenizer;
    }
View Full Code Here


    return defaultSchema;
  }

  public IQueryTokenizer getQueryTokenizer()
  {
    return new QueryTokenizer(";", "--", true);
  }
View Full Code Here

    public String getDefaultSchema() {
        return defaultSchema;
    }
   
    public IQueryTokenizer getQueryTokenizer() {
        return new QueryTokenizer(";", "--", true);
    }
View Full Code Here

         }

         final IQueryTokenizer queryTokenizer = _sess.getQueryTokenizer();
         final String statementSeparator = queryTokenizer.getSQLStatementSeparator();
         final String startOfLineComment = queryTokenizer.getLineCommentBegin();
         QueryTokenizer qt = new QueryTokenizer(statementSeparator, startOfLineComment, true);
         qt.setScriptToTokenize(hql);


         while(qt.hasQuery())
         {
            String hqlQuery = qt.nextQuery();
            if(false == doSQL(hqlQuery))
            {
               continue;
            }
View Full Code Here

public class SQLUtil {

  public static List<String> tokenize(String schema) {
    List<String> ret=new ArrayList<String>();
    if (schema!=null) {
    QueryTokenizer tokenizer=new QueryTokenizer(";","--",true);
    QueryTokenizer extraTokenizer=null;
    if (DbConnectionFactory.isMsSql()) {
      //";","--",true
      IQueryTokenizerPreferenceBean prefs = new MSSQLPreferenceBean();
      //prefs.setStatementSeparator("GO");
      extraTokenizer=new MSSQLQueryTokenizer(prefs);
    }else if(DbConnectionFactory.isOracle()){
      IQueryTokenizerPreferenceBean prefs = new OraclePreferenceBean();
      tokenizer=new OracleQueryTokenizer(prefs);
    }else if(DbConnectionFactory.isMySql()){
      IQueryTokenizerPreferenceBean prefs = new BaseQueryTokenizerPreferenceBean();
      prefs.setProcedureSeparator("#");
      tokenizer=new MysqlQueryTokenizer(prefs);

    }
    tokenizer.setScriptToTokenize(schema.toString());

     while (tokenizer.hasQuery() )
            {
               String querySql = tokenizer.nextQuery();
               if (querySql != null)
               {
                 if (extraTokenizer !=null) {
                   extraTokenizer.setScriptToTokenize(querySql);
                   if (extraTokenizer.hasQuery()) {
                     while (extraTokenizer.hasQuery()) {
                       String innerSql = extraTokenizer.nextQuery();
                       if (innerSql!=null) {

                         ret.add(innerSql);
                       }
                       }
View Full Code Here

TOP

Related Classes of net.sourceforge.squirrel_sql.fw.sql.QueryTokenizer

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.