如何设置H2流结果集? [英] How to set h2 to stream resultset?

查看:89
本文介绍了如何设置H2流结果集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Mysql驱动程序具有设置选项,因此结果集不会像在这里的

Mysql driver has options to set so that resultset will not be read completely in memory as in here http://dev.mysql.com/doc/connector-j/en/connector-j-reference-implementation-notes.html#ResultSet.

H2是否有同等的选择?

Is there an equivalent option for H2?

谢谢

推荐答案

H2当前不支持服务器端游标.但是,它将大结果集缓冲到磁盘(作为单独的文件或作为临时表).缺点是速度,但它不应该是内存使用方面的问题.

H2 currently does not support server side cursors. However, it buffers large result sets to disk (as a separate file, or as a temporary table). The disadvantage is speed, but it should not be a memory usage problems.

您可以使用 set max_memory_rows .您可以将其附加到数据库URL:jdbc:h2:~/test;max_memory_rows=100000.

一种解决方法通常是按照演示文稿.那将意味着运行多个查询,而不是一个.

A workaround is usually to use "keyset paging" as described in the presentation "Pagination Done the Right Way". That would mean running multiple queries instead of one.

我的计划是在接下来的几个月中在H2中实现服务器端游标.

My plan is to implement server side cursors in H2 in the next months.

这篇关于如何设置H2流结果集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆