Examples of executeQuery()


Examples of org.apache.metamodel.UpdateableDataContext.executeQuery()

        assertEquals(1, converters.size());
        dc = Converters.addTypeConverters(dc, converters);

        final Query q = dc.query().from(table).select("foo").toQuery();
        assertEquals("SELECT table.foo FROM schema.table", q.toSql());
        DataSet ds = dc.executeQuery(q);
        assertTrue(ds.next());
        assertEquals(1, ds.getRow().getValue(0));
        assertTrue(ds.next());
        assertEquals(2, ds.getRow().getValue(0));
        assertTrue(ds.next());
View Full Code Here

Examples of org.apache.metamodel.fixedwidth.FixedWidthDataContext.executeQuery()

        assertEquals("[greeting, greeter]", Arrays.toString(table.getColumnNames()));
        assertEquals(10, table.getColumnByName("greeting").getColumnSize().intValue());
        assertEquals(10, table.getColumnByName("greeter").getColumnSize().intValue());

        Query q = dc.query().from(table).select(table.getColumns()).toQuery();
        DataSet ds = dc.executeQuery(q);

        assertTrue(ds.next());
        assertEquals("[hello, world]", Arrays.toString(ds.getRow().getValues()));
        assertTrue(ds.next());
        assertEquals("[hi, there]", Arrays.toString(ds.getRow().getValues()));
View Full Code Here

Examples of org.apache.metamodel.jdbc.JdbcDataContext.executeQuery()

        q.toString());
    FilterItem f1 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 5);
    FilterItem f2 = new FilterItem(q.getSelectClause().getItem(0), OperatorType.EQUALS_TO, 8);
    q.where(new FilterItem(f1, f2));

    DataSet dataSet = dc.executeQuery(q);
    TableModel tableModel = new DataSetTableModel(dataSet);
    assertEquals(4, tableModel.getColumnCount());
    assertEquals(2, tableModel.getRowCount());
    assertEquals("LOLLOBRIGIDA", tableModel.getValueAt(0, 2));
View Full Code Here

Examples of org.apache.tapestry.contrib.jdbc.IStatement.executeQuery()

            assembly.newLine("FROM PUBLISHER");
            assembly.newLine("ORDER BY NAME");

            statement = assembly.createStatement(connection);

            set = statement.executeQuery();

            while (set.next())
            {
                Integer primaryKey = (Integer) set.getObject(1);
                String name = set.getString(2);
View Full Code Here

Examples of org.apache.tuscany.das.rdb.Command.executeQuery()

            Command select = das.createCommand("SELECT firstName, lastName, loginID, password, id FROM customers where loginID = ?");

            select.setParameter(1, logonID);

            DataObject root = select.executeQuery();
            conn.close();

            Collection customers = root.getList("CustomerProfileData");
            CustomerProfileData customerProfileData = (CustomerProfileData) customers.iterator().next();
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.commands.ReadCustomersByLastnameCommand.executeQuery()

  public void testReadSomeCustomers() throws Exception {
    ReadCustomersByLastnameCommand cmd = new ReadCustomersByLastnameCommand();
    cmd.setConnection(getConnection());
    cmd.setParameterValue("LASTNAME", "Williams");

    DataObject root = cmd.executeQuery();
    assertEquals(4, root.getList("CUSTOMER").size());

  }

  public void testReadCustomersStaticTypes() throws Exception {
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.commands.ReadCustomersCommand.executeQuery()

  public void testReadCustomers() throws Exception {
    ReadCustomersCommand cmd = new ReadCustomersCommand();
    cmd.setConnection(getConnection());

    DataObject root = cmd.executeQuery();
    assertEquals(5, root.getList("CUSTOMER").size());
  }

  public void testReadSomeCustomers() throws Exception {
    ReadCustomersByLastnameCommand cmd = new ReadCustomersByLastnameCommand();
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.commands.ReadCustomersStaticTypesCommand.executeQuery()

  public void testReadCustomersStaticTypes() throws Exception {
    ReadCustomersStaticTypesCommand cmd = new ReadCustomersStaticTypesCommand();
    cmd.setConnection(getConnection());
    cmd.setParameterValue("LASTNAME", "Williams");
   
    DataGraphRoot root = (DataGraphRoot) cmd.executeQuery();

    List customers = root.getCustomers();
    assertEquals(4, customers.size());
   
    Customer cust1 = (Customer) customers.get(0);
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.commands.ReadCustomersWithShapeCommand.executeQuery()

 
  public void testReadCustomersOrdersWithShape() throws Exception {
    ReadCustomersWithShapeCommand cmd = new ReadCustomersWithShapeCommand();
    cmd.setConnection(getConnection());
   
    DataObject root = cmd.executeQuery();
    assertEquals(5, root.getList("CUSTOMER").size());
  }
 
}
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.commands.SimpleReadCustomersWithShapeCommand.executeQuery()

  }
 
  public void testSimpleReadCustomersWithShape() throws Exception {
    SimpleReadCustomersWithShapeCommand cmd = new SimpleReadCustomersWithShapeCommand();
    cmd.setConnection(getConnection());   
    DataObject root = cmd.executeQuery();
    assertEquals(5, root.getList("CUSTOMER").size());
  }
 
  public void testReadCustomersOrdersWithShape() throws Exception {
    ReadCustomersWithShapeCommand cmd = new ReadCustomersWithShapeCommand();
View Full Code Here
TOP
Copyright © 2015 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.