Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2c705386
提交
2c705386
authored
16 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ResultSet.setFetchSize is now supported.
上级
effa19c7
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.1.x
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
version-1.4.187
version-1.4.186
version-1.4.185
version-1.4.184
version-1.4.183
version-1.4.182
version-1.4.181
version-1.4.178
version-1.4.177
version-1.3
version-1.2
version-1.1
version-1.0
无相关合并请求
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
47 行增加
和
12 行删除
+47
-12
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+16
-11
LocalResult.java
h2/src/main/org/h2/result/LocalResult.java
+8
-0
ResultInterface.java
h2/src/main/org/h2/result/ResultInterface.java
+14
-0
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+9
-1
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
2c705386
...
...
@@ -2437,7 +2437,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getFetchSize"
);
checkClosed
();
return
0
;
return
result
.
getFetchSize
()
;
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
...
...
@@ -2446,25 +2446,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
* Sets the number of rows suggested to read in one step. This value cannot
* be higher than the maximum rows (setMaxRows) set by the statement or
* prepared statement, otherwise an exception is throws.
* prepared statement, otherwise an exception is throws. Setting the value
* to 0 will set the default value. The default value can be changed using
* the system property h2.serverResultSetFetchSize.
*
* @param row
Count
the number of rows
* @param row
s
the number of rows
*/
public
void
setFetchSize
(
int
row
Count
)
throws
SQLException
{
public
void
setFetchSize
(
int
row
s
)
throws
SQLException
{
try
{
debugCodeCall
(
"setFetchSize"
,
row
Count
);
debugCodeCall
(
"setFetchSize"
,
row
s
);
checkClosed
();
if
(
rowCount
<
0
)
{
throw
Message
.
getInvalidValueException
(
""
+
rowCount
,
"rowCount"
);
}
if
(
rowCount
>
0
)
{
if
(
rows
<
0
)
{
throw
Message
.
getInvalidValueException
(
""
+
rows
,
"rows"
);
}
else
if
(
rows
>
0
)
{
if
(
stat
!=
null
)
{
int
maxRows
=
stat
.
getMaxRows
();
if
(
maxRows
>
0
&&
row
Count
>
maxRows
)
{
throw
Message
.
getInvalidValueException
(
""
+
row
Count
,
"rowCount
"
);
if
(
maxRows
>
0
&&
row
s
>
maxRows
)
{
throw
Message
.
getInvalidValueException
(
""
+
row
s
,
"rows
"
);
}
}
}
else
{
rows
=
SysProperties
.
SERVER_RESULT_SET_FETCH_SIZE
;
}
result
.
setFetchSize
(
rows
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/result/LocalResult.java
浏览文件 @
2c705386
...
...
@@ -470,4 +470,12 @@ public class LocalResult implements ResultInterface {
return
closed
;
}
public
int
getFetchSize
()
{
return
0
;
}
public
void
setFetchSize
(
int
fetchSize
)
{
// ignore
}
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/result/ResultInterface.java
浏览文件 @
2c705386
...
...
@@ -143,5 +143,19 @@ public interface ResultInterface {
* @return Column.NULLABLE_*
*/
int
getNullable
(
int
i
);
/**
* Set the fetch size for this result set.
*
* @param fetchSize the new fetch size
*/
void
setFetchSize
(
int
fetchSize
);
/**
* Get the current fetch size for this result set.
*
* @return the fetch size
*/
int
getFetchSize
();
}
This diff is collapsed.
Click to expand it.
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
2c705386
...
...
@@ -24,7 +24,7 @@ import org.h2.value.Value;
*/
public
class
ResultRemote
implements
ResultInterface
{
private
final
int
fetchSize
;
private
int
fetchSize
;
private
SessionRemote
session
;
private
Transfer
transfer
;
private
int
id
;
...
...
@@ -241,4 +241,12 @@ public class ResultRemote implements ResultInterface {
return
"columns: "
+
columns
.
length
+
" rows: "
+
rowCount
+
" pos: "
+
rowId
;
}
public
int
getFetchSize
()
{
return
fetchSize
;
}
public
void
setFetchSize
(
int
fetchSize
)
{
this
.
fetchSize
=
fetchSize
;
}
}
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论