gpt4 book ai didi

java - 查询游标如何工作

转载 作者:行者123 更新时间:2023-12-02 01:37:18 26 4
gpt4 key购买 nike

try (QueryCursor<List<?>> cursor = cache.query(sql)) {
for (List<?> row : cursor)
System.out.println("ROW :: " + row.get(0));
}

光标是否转到数据库并按列表获取列表,或者它是否包含整个数据。

QueryCursor<List<?>> cursor = cache.query(sqlQuery))

最佳答案

根据 the documentationJoakim 指出:

QueryCursor represents query result set and allows for transparent page-by-page iteration. Whenever user starts iterating over the last page, it will automatically request the next page in the background. For cases when pagination is not needed, you can use QueryCursor.getAll() method which will fetch the whole query result and store it in a collection.

关于java - 查询游标如何工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55042412/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com