Hi guys,
I use JDBC client driver to create a table,like:
stmt.executeUpdate("CREATE TABLE IF NOT EXISTS person ( id int,orgId LONG,
name VARCHAR, salary LONG ,PRIMARY KEY (id)) WITH \"backups=1,
affinityKey=id\"");
Could I use SqlQuery API to query this cache? I tried this way but does not
work
IgniteCache<Object, Person> cache =
ignite.cache("SQL_PUBLIC_PERSON").withKeepBinary();
SqlQuery sql = new SqlQuery("SQL_PUBLIC_PERSON","id >? and id <?");
try (QueryCursor<Map.Entry<Object, BinaryObject>> cursor =
cache.query(sql.setArgs(5,10))) {
for (Map.Entry<Object, BinaryObject> e : cursor)
System.out.println(e.getValue().toString());
}
Thanks
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/