Package org.apache.metamodel.jdbc

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


  // Test to query the film table (caused troubles in DataCleaner)
  public void testFilmQuery() throws Exception {
    DataContext dc = new JdbcDataContext(_connection);
    Table table = dc.getDefaultSchema().getTableByName("film");
    Query q = new Query().select(table.getColumns()).from(table).setMaxRows(400);
    dc.executeQuery(q);
  }

  public void testGetSchema() throws Exception {
    DataContext dc = new JdbcDataContext(_connection);
    Schema[] schemas = dc.getSchemas();
View Full Code Here


  }

  public void testQueryWithSingleQuote() throws Exception {
    DataContext dc = new JdbcDataContext(_connection, TableType.DEFAULT_TABLE_TYPES, "sakila");
    Query q = dc.query().from("category").selectCount().where("name").eq("kasper's horror movies").toQuery();
    DataSet ds = dc.executeQuery(q);
    assertTrue(ds.next());
    assertEquals(0, ((Number) ds.getRow().getValue(0)).intValue());
    assertFalse(ds.next());
  }
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.