如何为loadcache指定sql参数

时间:2016-12-27 07:41:18

标签: ignite

我正在使用以下将数据加载到缓存中的SQL

//There are 2 placeholders in the sql
String sql = "select * from person where id > ? and id < ?"

IgniteCache.loadCache(null, Integer.class.getName(), sql);

我如何设置sql的参数,如PreparedStatement呢?

1 个答案:

答案 0 :(得分:1)

不幸的是,Ignite并不支持loadCache()上的这种格式化。您只需传递多个查询:

IgniteCache.loadCache(null, Integer.class.getName(), sql1, Integer.class.getName(), sql2, ...);