Examples of group()


Examples of java.util.regex.Matcher.group()

      Matcher m = null;
      if ((m = pkPattern.matcher(modified)).matches()) {
        return new StringBuffer("SELECT k.Name AS attname, convert(Position, short) AS attnum, TableName AS relname, SchemaName AS nspname, TableName AS relname") //$NON-NLS-1$
                .append(" FROM SYS.KeyColumns k") //$NON-NLS-1$
                .append(" WHERE ") //$NON-NLS-1$
                .append(" UCASE(SchemaName)").append(" LIKE UCASE(").append(m.group(2)).append(")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                .append(" AND UCASE(TableName)") .append(" LIKE UCASE(").append(m.group(1)).append(")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                .append(" AND KeyType LIKE 'Primary'") //$NON-NLS-1$
                .append(" ORDER BY attnum").toString(); //$NON-NLS-1$         
      }
      else if ((m = pkKeyPattern.matcher(modified)).matches()) {
View Full Code Here

Examples of java.util.regex.Matcher.group()

      if ((m = pkPattern.matcher(modified)).matches()) {
        return new StringBuffer("SELECT k.Name AS attname, convert(Position, short) AS attnum, TableName AS relname, SchemaName AS nspname, TableName AS relname") //$NON-NLS-1$
                .append(" FROM SYS.KeyColumns k") //$NON-NLS-1$
                .append(" WHERE ") //$NON-NLS-1$
                .append(" UCASE(SchemaName)").append(" LIKE UCASE(").append(m.group(2)).append(")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                .append(" AND UCASE(TableName)") .append(" LIKE UCASE(").append(m.group(1)).append(")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                .append(" AND KeyType LIKE 'Primary'") //$NON-NLS-1$
                .append(" ORDER BY attnum").toString(); //$NON-NLS-1$         
      }
      else if ((m = pkKeyPattern.matcher(modified)).matches()) {
        String tableName = m.group(1);
View Full Code Here

Examples of java.util.regex.Matcher.group()

                .append(" AND UCASE(TableName)") .append(" LIKE UCASE(").append(m.group(1)).append(")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                .append(" AND KeyType LIKE 'Primary'") //$NON-NLS-1$
                .append(" ORDER BY attnum").toString(); //$NON-NLS-1$         
      }
      else if ((m = pkKeyPattern.matcher(modified)).matches()) {
        String tableName = m.group(1);
        if (tableName.endsWith("_pkey'")) { //$NON-NLS-1$
          tableName = tableName.substring(0, tableName.length()-6) + '\'';
          return "select ia.attname, ia.attnum, ic.relname, n.nspname, NULL "+ //$NON-NLS-1$ 
            "from pg_catalog.pg_attribute ia, pg_catalog.pg_class ic, pg_catalog.pg_namespace n, Sys.KeyColumns kc "+ //$NON-NLS-1$ 
            "where ic.relname = "+tableName+" AND n.nspname = "+m.group(2)+" AND "+ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
View Full Code Here

Examples of java.util.regex.Matcher.group()

        String tableName = m.group(1);
        if (tableName.endsWith("_pkey'")) { //$NON-NLS-1$
          tableName = tableName.substring(0, tableName.length()-6) + '\'';
          return "select ia.attname, ia.attnum, ic.relname, n.nspname, NULL "+ //$NON-NLS-1$ 
            "from pg_catalog.pg_attribute ia, pg_catalog.pg_class ic, pg_catalog.pg_namespace n, Sys.KeyColumns kc "+ //$NON-NLS-1$ 
            "where ic.relname = "+tableName+" AND n.nspname = "+m.group(2)+" AND "+ //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            "n.oid = ic.relnamespace AND ia.attrelid = ic.oid AND kc.SchemaName = n.nspname " +//$NON-NLS-1$ 
            "AND kc.TableName = ic.relname AND kc.KeyType = 'Primary' AND kc.Name = ia.attname order by ia.attnum";//$NON-NLS-1$ 
        }
        return "SELECT NULL, NULL, NULL, NULL, NULL FROM (SELECT 1) as X WHERE 0=1"; //$NON-NLS-1$
      }
View Full Code Here

Examples of java.util.regex.Matcher.group()

        return "SELECT NULL, NULL, NULL, NULL, NULL FROM (SELECT 1) as X WHERE 0=1"; //$NON-NLS-1$
      }
      else if ((m = fkPattern.matcher(modified)).matches()){
        return "SELECT PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_CAT, FKTABLE_SCHEM, "+//$NON-NLS-1$
              "FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, UPDATE_RULE, DELETE_RULE, FK_NAME, PK_NAME, DEFERRABILITY "+//$NON-NLS-1$
              "FROM SYS.ReferenceKeyColumns WHERE PKTABLE_NAME LIKE "+m.group(14)+" and PKTABLE_SCHEM LIKE "+m.group(15);//$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.equalsIgnoreCase("select version()")) { //$NON-NLS-1$
        return "SELECT 'Teiid "+ApplicationInfo.getInstance().getReleaseNumber()+"'"; //$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.startsWith("SELECT name FROM master..sysdatabases")) { //$NON-NLS-1$
View Full Code Here

Examples of java.util.regex.Matcher.group()

        return "SELECT NULL, NULL, NULL, NULL, NULL FROM (SELECT 1) as X WHERE 0=1"; //$NON-NLS-1$
      }
      else if ((m = fkPattern.matcher(modified)).matches()){
        return "SELECT PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_CAT, FKTABLE_SCHEM, "+//$NON-NLS-1$
              "FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, UPDATE_RULE, DELETE_RULE, FK_NAME, PK_NAME, DEFERRABILITY "+//$NON-NLS-1$
              "FROM SYS.ReferenceKeyColumns WHERE PKTABLE_NAME LIKE "+m.group(14)+" and PKTABLE_SCHEM LIKE "+m.group(15);//$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.equalsIgnoreCase("select version()")) { //$NON-NLS-1$
        return "SELECT 'Teiid "+ApplicationInfo.getInstance().getReleaseNumber()+"'"; //$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.startsWith("SELECT name FROM master..sysdatabases")) { //$NON-NLS-1$
View Full Code Here

Examples of java.util.regex.Matcher.group()

      return "select 63"; //$NON-NLS-1$
    }
    else {
      Matcher m = setPattern.matcher(sql);
      if (m.matches()) {
        return "SET " + m.group(2) + " " + m.group(4); //$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.equalsIgnoreCase("BEGIN")) { //$NON-NLS-1$
        return "START TRANSACTION"; //$NON-NLS-1$
      }
      else if ((m = rollbackPattern.matcher(modified)).matches()) {
View Full Code Here

Examples of java.util.regex.Matcher.group()

      return "select 63"; //$NON-NLS-1$
    }
    else {
      Matcher m = setPattern.matcher(sql);
      if (m.matches()) {
        return "SET " + m.group(2) + " " + m.group(4); //$NON-NLS-1$ //$NON-NLS-2$
      }
      else if (modified.equalsIgnoreCase("BEGIN")) { //$NON-NLS-1$
        return "START TRANSACTION"; //$NON-NLS-1$
      }
      else if ((m = rollbackPattern.matcher(modified)).matches()) {
View Full Code Here

Examples of java.util.regex.Matcher.group()

      }
      else if ((m = releasePattern.matcher(modified)).matches()) {
        return "SELECT 'RELEASE'"; //$NON-NLS-1$
      }   
      else if ((m = deallocatePattern.matcher(modified)).matches()) {
        closePreparedStatement(m.group(1));
        return "SELECT 'DEALLOCATE'"; //$NON-NLS-1$
      }         
    }
    modified = sql;
    //these are somewhat dangerous
View Full Code Here

Examples of java.util.regex.Matcher.group()

          log("  checking " + file + " for GRE_PATH");
          String fileText = FileUtil.readFileAsString(file, 16384);
          if (fileText != null) {
            Matcher matcher = pat.matcher(fileText);
            if (matcher.find()) {
              String possibleGrePath = matcher.group(1);
              if (isValidGrePath(new File(possibleGrePath))) {
                grePath = possibleGrePath;
                break;
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.