Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
27026f99
提交
27026f99
authored
10月 06, 2010
作者:
Sergi Vladykin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support of stored procedures with OUT parameters in CallableStatement is implemented
上级
f97ba1cb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
426 行增加
和
276 行删除
+426
-276
changelog.html
h2/src/docsrc/html/changelog.html
+2
-1
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+370
-274
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+1
-1
TestCallableStatement.java
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
+53
-0
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
27026f99
...
@@ -18,7 +18,8 @@ Change Log
...
@@ -18,7 +18,8 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
PreparedStatement.getMetaData() was not always consistent with resulting ResultSet.getMetaData().
<ul><li>
Support of stored procedures with OUT parameters in CallableStatement is implemented.
</li><li>
PreparedStatement.getMetaData() was not always consistent with resulting ResultSet.getMetaData().
</li><li>
The build tool now uses JAVA_HOME for javac as well. Issue 233.
</li><li>
The build tool now uses JAVA_HOME for javac as well. Issue 233.
</li><li>
Opening and closing encrypted databases is now much faster.
</li><li>
Opening and closing encrypted databases is now much faster.
</li><li>
H2 Console: new experimental feature to support file download and upload,
</li><li>
H2 Console: new experimental feature to support file download and upload,
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
27026f99
差异被折叠。
点击展开。
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
27026f99
...
@@ -60,7 +60,7 @@ import java.sql.SQLXML;
...
@@ -60,7 +60,7 @@ import java.sql.SQLXML;
public
class
JdbcPreparedStatement
extends
JdbcStatement
implements
PreparedStatement
{
public
class
JdbcPreparedStatement
extends
JdbcStatement
implements
PreparedStatement
{
private
final
String
sqlStatement
;
private
final
String
sqlStatement
;
pr
ivate
CommandInterface
command
;
pr
otected
CommandInterface
command
;
private
ArrayList
<
Value
[]>
batchParameters
;
private
ArrayList
<
Value
[]>
batchParameters
;
JdbcPreparedStatement
(
JdbcConnection
conn
,
String
sql
,
int
id
,
int
resultSetType
,
JdbcPreparedStatement
(
JdbcConnection
conn
,
String
sql
,
int
id
,
int
resultSetType
,
...
...
h2/src/test/org/h2/test/jdbc/TestCallableStatement.java
浏览文件 @
27026f99
...
@@ -11,8 +11,11 @@ import java.sql.Connection;
...
@@ -11,8 +11,11 @@ import java.sql.Connection;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.sql.Timestamp
;
import
java.sql.Types
;
import
org.h2.test.TestBase
;
import
org.h2.test.TestBase
;
import
org.h2.tools.SimpleResultSet
;
/**
/**
* Tests for the CallableStatement class.
* Tests for the CallableStatement class.
...
@@ -57,6 +60,56 @@ public class TestCallableStatement extends TestBase {
...
@@ -57,6 +60,56 @@ public class TestCallableStatement extends TestBase {
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
"Hello"
,
rs
.
getString
(
2
));
assertEquals
(
"Hello"
,
rs
.
getString
(
2
));
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
stat
.
execute
(
"CREATE ALIAS testcall FOR \""
+
getClass
().
getName
()
+
".testCall\""
);
call
=
conn
.
prepareCall
(
"{CALL testcall(?,?,?)}"
);
call
.
setInt
(
"A"
,
100
);
call
.
setString
(
2
,
"abc"
);
long
t
=
System
.
currentTimeMillis
();
call
.
setTimestamp
(
"C"
,
new
Timestamp
(
t
));
call
.
registerOutParameter
(
1
,
Types
.
INTEGER
);
call
.
registerOutParameter
(
"B"
,
Types
.
VARCHAR
);
call
.
executeUpdate
();
try
{
call
.
getTimestamp
(
"C"
);
fail
(
"not registered out parameter accessible"
);
}
catch
(
SQLException
e
)
{
// expected exception
}
call
.
registerOutParameter
(
3
,
Types
.
TIMESTAMP
);
call
.
executeUpdate
();
assertEquals
(
t
+
1
,
call
.
getTimestamp
(
3
).
getTime
());
assertEquals
(
200
,
call
.
getInt
(
"A"
));
assertEquals
(
"ABC"
,
call
.
getString
(
"B"
));
try
{
call
.
getString
(
100
);
fail
(
"incorrect parameter index value"
);
}
catch
(
SQLException
e
)
{
// expected exception
}
try
{
call
.
getString
(
0
);
fail
(
"incorrect parameter index value"
);
}
catch
(
SQLException
e
)
{
// expected exception
}
try
{
call
.
getBoolean
(
"ASD"
);
fail
(
"incorrect parameter name value"
);
}
catch
(
SQLException
e
)
{
// expected exception
}
}
public
static
ResultSet
testCall
(
Connection
connect
,
int
a
,
String
b
,
Timestamp
c
)
throws
SQLException
{
SimpleResultSet
rs
=
new
SimpleResultSet
();
rs
.
addColumn
(
"A"
,
Types
.
INTEGER
,
0
,
0
);
rs
.
addColumn
(
"B"
,
Types
.
VARCHAR
,
0
,
0
);
rs
.
addColumn
(
"C"
,
Types
.
TIMESTAMP
,
0
,
0
);
if
(
"jdbc:columnlist:connection"
.
equals
(
connect
.
getMetaData
().
getURL
()))
{
return
rs
;
}
rs
.
addRow
(
a
*
2
,
b
.
toUpperCase
(),
new
Timestamp
(
c
.
getTime
()
+
1
));
return
rs
;
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论