Query q = qm.createQuery("select text from [nt:base] where id = $id", Query.JCR_SQL2);
q.bindValue("id", vf.createValue("1"));
QueryResult r = q.execute();
RowIterator it = r.getRows();
assertTrue(it.hasNext());
Row row = it.nextRow();
assertEquals("hello_world", row.getValue("text").getString());
String[] columns = r.getColumnNames();
assertEquals(1, columns.length);
assertEquals("text", columns[0]);
assertFalse(it.hasNext());