use of org.h2.test.db.Db.Prepared in project h2database by h2database.
the class H2Database method rawQuery.
/**
* Execute the query.
*
* @param sql the SQL statement
* @param selectionArgs the parameter values
* @return the cursor
*/
public Cursor rawQuery(String sql, String[] selectionArgs) {
Prepared prep = prepare(sql, selectionArgs);
ResultInterface result = prep.query(0);
return new H2Cursor(result);
}
use of org.h2.test.db.Db.Prepared in project h2database by h2database.
the class H2Database method prepare.
private Prepared prepare(String sql, Object[] args) {
Prepared prep = session.prepare(sql);
int len = args.length;
if (len > 0) {
ArrayList<Parameter> params = prep.getParameters();
for (int i = 0; i < len; i++) {
Parameter p = params.get(i);
p.setValue(getValue(args[i]));
}
}
return prep;
}
Aggregations