Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
bb517162
提交
bb517162
authored
10月 09, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Documentation.
上级
73cd2b87
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
31 行增加
和
14 行删除
+31
-14
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+20
-6
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+8
-6
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+3
-2
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
bb517162
...
...
@@ -36,8 +36,9 @@ import org.h2.value.ValueNull;
/**
* Represents a callable statement.
*
*
* @author Sergi Vladykin
* @author Thomas Mueller
*/
public
class
JdbcCallableStatement
extends
JdbcPreparedStatement
implements
CallableStatement
{
...
...
@@ -51,7 +52,20 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
}
/**
* @see java.sql.PreparedStatement#executeUpdate()
* Executes a statement (insert, update, delete, create, drop)
* and returns the update count.
* If another result set exists for this statement, this will be closed
* (even if this statement fails).
*
* If auto commit is on, this statement will be committed.
* If the statement is a DDL statement (create, drop, alter) and does not
* throw an exception, the current transaction (if any) is committed after
* executing the statement.
*
* @return the update count (number of row affected by an insert, update or
* delete, or 0 if no rows or the statement was a create, drop,
* commit or rollback)
* @throws SQLException if this object is closed or invalid
*/
public
int
executeUpdate
()
throws
SQLException
{
if
(
command
.
isQuery
())
{
...
...
@@ -82,13 +96,13 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
}
return
meta
;
}
private
void
checkIndexBounds
(
int
parameterIndex
)
throws
SQLException
{
if
(
parameterIndex
<
1
||
parameterIndex
>
maxOutParameters
)
{
throw
DbException
.
getInvalidValueException
(
Integer
.
toString
(
parameterIndex
),
"parameterIndex"
);
}
}
}
private
void
registerOutParameter
(
int
parameterIndex
,
int
sqlType
,
int
scale
,
String
typeName
)
throws
SQLException
{
try
{
if
(
outParameters
==
null
)
{
...
...
@@ -106,7 +120,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
throw
logAndConvert
(
e
);
}
}
private
void
checkRegistered
(
int
parameterIndex
)
throws
SQLException
{
try
{
checkIndexBounds
(
parameterIndex
);
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
bb517162
...
...
@@ -59,8 +59,8 @@ import java.sql.SQLXML;
*/
public
class
JdbcPreparedStatement
extends
JdbcStatement
implements
PreparedStatement
{
private
final
String
sqlStatement
;
protected
CommandInterface
command
;
private
final
String
sqlStatement
;
private
ArrayList
<
Value
[]>
batchParameters
;
JdbcPreparedStatement
(
JdbcConnection
conn
,
String
sql
,
int
id
,
int
resultSetType
,
...
...
@@ -106,13 +106,15 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
/**
* Executes a statement (insert, update, delete, create, drop, commit,
* rollback) and returns the update count. If another result set exists for
* this statement, this will be closed (even if this statement fails).
* Executes a statement (insert, update, delete, create, drop)
* and returns the update count.
* If another result set exists for this statement, this will be closed
* (even if this statement fails).
*
* If the statement is a create or drop and does not throw an exception, the
* current transaction (if any) is committed after executing the statement.
* If auto commit is on, this statement will be committed.
* If the statement is a DDL statement (create, drop, alter) and does not
* throw an exception, the current transaction (if any) is committed after
* executing the statement.
*
* @return the update count (number of row affected by an insert, update or
* delete, or 0 if no rows or the statement was a create, drop,
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
bb517162
...
...
@@ -93,9 +93,10 @@ public class JdbcStatement extends TraceObject implements Statement {
* If another result set exists for this statement, this will be closed
* (even if this statement fails).
*
* If the statement is a create or drop and does not throw an exception,
* the current transaction (if any) is committed after executing the statement.
* If auto commit is on, this statement will be committed.
* If the statement is a DDL statement (create, drop, alter) and does not
* throw an exception, the current transaction (if any) is committed after
* executing the statement.
*
* @param sql the SQL statement
* @return the update count (number of row affected by an insert,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论