Package org.jooq

Examples of org.jooq.SelectQuery.execute()


        Field<Integer> f2 = val(10).div(5).add(val(3).sub(2));
        Field<Integer> f3 = val(10).mod(3);

        SelectQuery q1 = create().selectQuery();
        q1.addSelect(f1, f2, f3);
        q1.execute();

        Result<?> result = q1.getResult();
        assertEquals(1, result.size());
        assertEquals(Integer.valueOf(3), result.getValue(0, f1));
        assertEquals(Integer.valueOf(3), result.getValue(0, f2));
View Full Code Here


        SelectQuery q2 = create().selectQuery();
        q2.addSelect(f4);
        q2.addSelect(f5);
        q2.addFrom(TBook());
        q2.addConditions(TBook_TITLE().equal("1984"));
        q2.execute();

        result = q2.getResult();
        assertEquals(Integer.valueOf((1948 + 3) / 7), result.getValue(0, f4));
        assertEquals(Integer.valueOf((1948 - 4) * -8), result.getValue(0, f5));
    }
View Full Code Here

    q.addConditions(TAuthor.YEAR_OF_BIRTH.greaterThan(1920));
    q.addConditions(TAuthor.FIRST_NAME.equal("Paulo"));
    q.addOrderBy(TBook.TITLE);

    // Execute the query and fetch the results
    q.execute();
    Result<?> result = q.getResult();

    // Loop over the resulting records
    for (Record record : result) {
View Full Code Here

        q.addSelect(Tables.TABSCHEMA.trim());
        q.addSelect(Tables.TABNAME);
        q.addConditions(Tables.TABSCHEMA.in(getInputSchemata()));
        q.addConditions(Tables.TYPE.in("T", "V")); // tables and views
        q.addOrderBy(Tables.TABNAME);
        q.execute();

        for (Record record : q.getResult()) {
            SchemaDefinition schema = getSchema(record.getValue(Tables.TABSCHEMA.trim()));
            String name = record.getValue(Tables.TABNAME);
            String comment = "";
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.