Package java.util

Examples of java.util.ArrayList


        GroupSymbol g1 = new GroupSymbol("db.g1"); //$NON-NLS-1$
        GroupSymbol g2 = new GroupSymbol("db.g2"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getRightClause().setMakeDep(true);
        From from = new From();
        from.addClause(jp);
View Full Code Here


        GroupSymbol g1 = new GroupSymbol("db.g1"); //$NON-NLS-1$
        GroupSymbol g2 = new GroupSymbol("db.g2"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getLeftClause().setMakeDep(true);
        From from = new From();
        from.addClause(jp);
View Full Code Here

        GroupSymbol g3 = new GroupSymbol("db.g3"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
        ElementSymbol c = new ElementSymbol("c")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getLeftClause().setMakeDep(true);
        List crits2 = new ArrayList();
        crits2.add(new CompareCriteria(a, CompareCriteria.EQ, c));
        JoinPredicate jp2 = new JoinPredicate(jp, new UnaryFromClause(g3), JoinType.JOIN_LEFT_OUTER, crits2);
        jp2.getRightClause().setMakeDep(true);
        From from = new From();
        from.addClause(jp2);
View Full Code Here

        GroupSymbol g1 = new GroupSymbol("db.g1"); //$NON-NLS-1$
        GroupSymbol g2 = new GroupSymbol("db.g2"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getRightClause().setMakeNotDep(true);
        From from = new From();
        from.addClause(jp);
View Full Code Here

        GroupSymbol g1 = new GroupSymbol("db.g1"); //$NON-NLS-1$
        GroupSymbol g2 = new GroupSymbol("db.g2"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getLeftClause().setMakeNotDep(true);
        From from = new From();
        from.addClause(jp);
View Full Code Here

    /**
     * @param yahooUrl
     * @return
     */
    protected List executeUrl(String yahooUrl) throws TranslatorException {
        List rows = new ArrayList();
        InputStreamReader inSR  = null;
        BufferedReader buffReader = null;
       
        try {
            // create the URL object
            URL url = new URL(yahooUrl);
           
            // create the connection to the URL
            URLConnection conn = url.openConnection();

            // establish the connection to the URL                         
            conn.connect();
           
            // get the stream from the commection
            inSR = new InputStreamReader(conn.getInputStream());
           
            // place the stream into a buffered reader
            buffReader = new BufferedReader(inSR);         
           
            // now read each line from the Yahoo! Source and place
            // it into a StringBuffer object
            String line = null;
            while((line = buffReader.readLine()) != null){
                rows.add(parseLine(line));
            }
            // clean up our opened connections
            buffReader.close();
            inSR.close();
                       
View Full Code Here

        GroupSymbol g3 = new GroupSymbol("db.g3"); //$NON-NLS-1$
        ElementSymbol a = new ElementSymbol("a")//$NON-NLS-1$
        ElementSymbol b = new ElementSymbol("b")//$NON-NLS-1$
        ElementSymbol c = new ElementSymbol("c")//$NON-NLS-1$
       
        List crits = new ArrayList();
        crits.add(new CompareCriteria(a, CompareCriteria.EQ, b));
        JoinPredicate jp = new JoinPredicate(new UnaryFromClause(g1), new UnaryFromClause(g2), JoinType.JOIN_INNER, crits);
        jp.getLeftClause().setMakeNotDep(true);
        List crits2 = new ArrayList();
        crits2.add(new CompareCriteria(a, CompareCriteria.EQ, c));
        JoinPredicate jp2 = new JoinPredicate(jp, new UnaryFromClause(g3), JoinType.JOIN_LEFT_OUTER, crits2);
        jp2.getRightClause().setMakeNotDep(true);
        From from = new From();
        from.addClause(jp2);
View Full Code Here

    /**
     * @param line
     * @return
     */
    static List parseLine(String line) {
        List row = new ArrayList();
        StringTokenizer rowToken = new StringTokenizer(line,","); //$NON-NLS-1$
        for(int i=0; rowToken.hasMoreTokens(); i++){
            String data = rowToken.nextToken();
            if(data.charAt(0) == '"') {
                data = data.substring(1, data.length()-1);
            }
           
            if(data.equals("N/A")) { //$NON-NLS-1$
                row.add(null);
            } else if(i==1 || i==4 || i== 5 || i==6 || i==7) {
                row.add(Double.valueOf(data));
            } else if(i==8) {
                row.add(new BigInteger(data));
            } else if(i==2) {
                if(!data.equals("0")){ //$NON-NLS-1$
                    try {
                        Date date = DATE_FORMAT.parse(data);
                        row.add(new java.sql.Date(date.getTime()));
                    } catch(ParseException e) {
                        Object[] params = new Object[] { data, e.getMessage() };
                        LogManager.logWarning(LogConstants.CTX_CONNECTOR, YahooPlugin.Util.getString("YahooExecution.Parse_date_error", params)); //$NON-NLS-1$
                        row.add(null);
                    }
                } else{
                    row.add(null);
                }
            } else if(i==3) {
                if(!data.equals("0")){ //$NON-NLS-1$
                    try {
                        Date time = TIME_FORMAT.parse(data);
                        row.add(new java.sql.Time(time.getTime()));
                    } catch(ParseException e) {
                        Object[] params = new Object[] { data, e.getMessage() };
                        LogManager.logWarning(LogConstants.CTX_CONNECTOR, YahooPlugin.Util.getString("YahooExecution.Parse_time_value", params)); //$NON-NLS-1$
                        row.add(null);
                    }
                } else {
                    row.add(null);
                }
               
            } else {
                row.add(data);
            }
        }
       
        return row;
    }
View Full Code Here

    }
   
    @Test public void testInsertWithOption() {
        Insert insert = new Insert();
        insert.setGroup(new GroupSymbol("m.g")); //$NON-NLS-1$
        List vars = new ArrayList();
        vars.add(new ElementSymbol("a"));         //$NON-NLS-1$
        insert.setVariables(vars);
        List values = new ArrayList();
        values.add(new Reference(0));
        insert.setValues(values);
        Option option = new Option();
        option.setNoCache(true);      
        insert.setOption(option);
        TestParser.helpTest("INSERT INTO m.g (a) VALUES (?) OPTION NOCACHE"//$NON-NLS-1$
View Full Code Here

        ufc.setGroup(new GroupSymbol("t1")); //$NON-NLS-1$
       
        SubqueryFromClause sfc = new SubqueryFromClause("x", query2);//$NON-NLS-1$
        sfc.setOptional(true);
       
        List criteria = new ArrayList();
        criteria.add(new CompareCriteria(new ElementSymbol("t1.a"), AbstractCompareCriteria.EQ, new ElementSymbol("x.a")));//$NON-NLS-1$//$NON-NLS-2$
        JoinPredicate joinPredicate = new JoinPredicate(ufc, sfc, JoinType.JOIN_INNER, criteria);
        from.addClause(joinPredicate);
        query.setFrom(from);          

        TestParser.helpTest(sql, "SELECT * FROM t1 INNER JOIN /*+ optional */ (SELECT a FROM t1, t2) AS x ON t1.a = x.a", query);         //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of java.util.ArrayList

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.