Example #1
0
 public void testQueriesWithNullResultSets() throws Exception {
   try {
     h.select("insert into something (id, name) values (?, ?)", 1, "hello");
   } catch (NoResultsException e) {
     return;
   }
   fail("expected NoResultsException");
 }
Example #2
0
  public void testConvenienceMethodWithParam() throws Exception {
    h.insert("insert into something (id, name) values (1, 'eric')");
    h.insert("insert into something (id, name) values (2, 'brian')");

    List<Map<String, Object>> r = h.select("select * from something where id = ?", 1);
    assertEquals(1, r.size());
    assertEquals("eric", r.get(0).get("name"));
  }