Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
2c705386
提交
2c705386
authored
7月 31, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ResultSet.setFetchSize is now supported.
上级
effa19c7
显示空白字符变更
内嵌
并排
正在显示
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 {
...
@@ -2437,7 +2437,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
try
{
debugCodeCall
(
"getFetchSize"
);
debugCodeCall
(
"getFetchSize"
);
checkClosed
();
checkClosed
();
return
0
;
return
result
.
getFetchSize
()
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
throw
logAndConvert
(
e
);
}
}
...
@@ -2446,25 +2446,30 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
...
@@ -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
* 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
* 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
{
try
{
debugCodeCall
(
"setFetchSize"
,
row
Count
);
debugCodeCall
(
"setFetchSize"
,
row
s
);
checkClosed
();
checkClosed
();
if
(
rowCount
<
0
)
{
throw
Message
.
getInvalidValueException
(
""
+
rowCount
,
"rowCount"
);
if
(
rows
<
0
)
{
}
throw
Message
.
getInvalidValueException
(
""
+
rows
,
"rows"
);
if
(
rowCount
>
0
)
{
}
else
if
(
rows
>
0
)
{
if
(
stat
!=
null
)
{
if
(
stat
!=
null
)
{
int
maxRows
=
stat
.
getMaxRows
();
int
maxRows
=
stat
.
getMaxRows
();
if
(
maxRows
>
0
&&
row
Count
>
maxRows
)
{
if
(
maxRows
>
0
&&
row
s
>
maxRows
)
{
throw
Message
.
getInvalidValueException
(
""
+
row
Count
,
"rowCount
"
);
throw
Message
.
getInvalidValueException
(
""
+
row
s
,
"rows
"
);
}
}
}
}
}
else
{
rows
=
SysProperties
.
SERVER_RESULT_SET_FETCH_SIZE
;
}
}
result
.
setFetchSize
(
rows
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/result/LocalResult.java
浏览文件 @
2c705386
...
@@ -470,4 +470,12 @@ public class LocalResult implements ResultInterface {
...
@@ -470,4 +470,12 @@ public class LocalResult implements ResultInterface {
return
closed
;
return
closed
;
}
}
public
int
getFetchSize
()
{
return
0
;
}
public
void
setFetchSize
(
int
fetchSize
)
{
// ignore
}
}
}
h2/src/main/org/h2/result/ResultInterface.java
浏览文件 @
2c705386
...
@@ -144,4 +144,18 @@ public interface ResultInterface {
...
@@ -144,4 +144,18 @@ public interface ResultInterface {
*/
*/
int
getNullable
(
int
i
);
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
();
}
}
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
2c705386
...
@@ -24,7 +24,7 @@ import org.h2.value.Value;
...
@@ -24,7 +24,7 @@ import org.h2.value.Value;
*/
*/
public
class
ResultRemote
implements
ResultInterface
{
public
class
ResultRemote
implements
ResultInterface
{
private
final
int
fetchSize
;
private
int
fetchSize
;
private
SessionRemote
session
;
private
SessionRemote
session
;
private
Transfer
transfer
;
private
Transfer
transfer
;
private
int
id
;
private
int
id
;
...
@@ -241,4 +241,12 @@ public class ResultRemote implements ResultInterface {
...
@@ -241,4 +241,12 @@ public class ResultRemote implements ResultInterface {
return
"columns: "
+
columns
.
length
+
" rows: "
+
rowCount
+
" pos: "
+
rowId
;
return
"columns: "
+
columns
.
length
+
" rows: "
+
rowCount
+
" pos: "
+
rowId
;
}
}
public
int
getFetchSize
()
{
return
fetchSize
;
}
public
void
setFetchSize
(
int
fetchSize
)
{
this
.
fetchSize
=
fetchSize
;
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论