Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1538a750
提交
1538a750
authored
4月 08, 2011
作者:
noelgrandin@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary throws clauses from methods
上级
88109360
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
47 行增加
和
49 行删除
+47
-49
JdbcArray.java
h2/src/main/org/h2/jdbc/JdbcArray.java
+1
-1
JdbcBlob.java
h2/src/main/org/h2/jdbc/JdbcBlob.java
+1
-1
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+1
-1
JdbcClob.java
h2/src/main/org/h2/jdbc/JdbcClob.java
+1
-1
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+8
-8
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+1
-1
JdbcParameterMetaData.java
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
+2
-2
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+2
-2
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+10
-10
JdbcResultSetMetaData.java
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
+2
-2
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+6
-6
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+1
-1
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+3
-3
TcpServerThread.java
h2/src/main/org/h2/server/TcpServerThread.java
+2
-2
DeleteDbFiles.java
h2/src/main/org/h2/tools/DeleteDbFiles.java
+2
-4
Restore.java
h2/src/main/org/h2/tools/Restore.java
+2
-2
SmallMap.java
h2/src/main/org/h2/util/SmallMap.java
+2
-2
没有找到文件。
h2/src/main/org/h2/jdbc/JdbcArray.java
浏览文件 @
1538a750
...
...
@@ -237,7 +237,7 @@ public class JdbcArray extends TraceObject implements Array {
return
rs
;
}
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
conn
.
checkClosed
();
if
(
value
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
...
...
h2/src/main/org/h2/jdbc/JdbcBlob.java
浏览文件 @
1538a750
...
...
@@ -313,7 +313,7 @@ public class JdbcBlob extends TraceObject implements Blob {
throw
unsupported
(
"LOB update"
);
}
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
conn
.
checkClosed
();
if
(
value
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
1538a750
...
...
@@ -1510,7 +1510,7 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
return
meta
;
}
private
void
checkIndexBounds
(
int
parameterIndex
)
throws
SQLException
{
private
void
checkIndexBounds
(
int
parameterIndex
)
{
checkClosed
();
if
(
parameterIndex
<
1
||
parameterIndex
>
maxOutParameters
)
{
throw
DbException
.
getInvalidValueException
(
"parameterIndex"
,
parameterIndex
);
...
...
h2/src/main/org/h2/jdbc/JdbcClob.java
浏览文件 @
1538a750
...
...
@@ -260,7 +260,7 @@ public class JdbcClob extends TraceObject implements Clob
}
//## Java 1.6 end ##
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
conn
.
checkClosed
();
if
(
value
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
1538a750
...
...
@@ -1332,9 +1332,9 @@ public class JdbcConnection extends TraceObject implements Connection {
* Check if this connection is closed.
* The next operation is a read request.
*
* @throws
SQL
Exception if the connection or session is closed
* @throws
Db
Exception if the connection or session is closed
*/
protected
void
checkClosed
()
throws
SQLException
{
protected
void
checkClosed
()
{
checkClosed
(
false
);
}
...
...
@@ -1342,9 +1342,9 @@ public class JdbcConnection extends TraceObject implements Connection {
* Check if this connection is closed.
* The next operation may be a write request.
*
* @throws
SQL
Exception if the connection or session is closed
* @throws
Db
Exception if the connection or session is closed
*/
private
void
checkClosedForWrite
()
throws
SQLException
{
private
void
checkClosedForWrite
()
{
checkClosed
(
true
);
}
...
...
@@ -1353,9 +1353,9 @@ public class JdbcConnection extends TraceObject implements Connection {
* Check if this connection is closed.
*
* @param write if the next operation is possibly writing
* @throws
SQL
Exception if the connection or session is closed
* @throws
Db
Exception if the connection or session is closed
*/
protected
void
checkClosed
(
boolean
write
)
throws
SQLException
{
protected
void
checkClosed
(
boolean
write
)
{
if
(
session
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
}
...
...
@@ -1380,12 +1380,12 @@ public class JdbcConnection extends TraceObject implements Connection {
}
}
String
getURL
()
throws
SQLException
{
String
getURL
()
{
checkClosed
();
return
url
;
}
String
getUser
()
throws
SQLException
{
String
getUser
()
{
checkClosed
();
return
user
;
}
...
...
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
1538a750
...
...
@@ -2737,7 +2737,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
// =============================================================
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
conn
.
checkClosed
();
}
...
...
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
浏览文件 @
1538a750
...
...
@@ -196,7 +196,7 @@ public class JdbcParameterMetaData extends TraceObject implements ParameterMetaD
}
}
private
ParameterInterface
getParameter
(
int
param
)
throws
SQLException
{
private
ParameterInterface
getParameter
(
int
param
)
{
checkClosed
();
if
(
param
<
1
||
param
>
paramCount
)
{
throw
DbException
.
getInvalidValueException
(
"param"
,
param
);
...
...
@@ -204,7 +204,7 @@ public class JdbcParameterMetaData extends TraceObject implements ParameterMetaD
return
parameters
.
get
(
param
-
1
);
}
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
prep
.
checkClosed
();
}
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
1538a750
...
...
@@ -1262,7 +1262,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
// =============================================================
private
void
setParameter
(
int
parameterIndex
,
Value
value
)
throws
SQLException
{
private
void
setParameter
(
int
parameterIndex
,
Value
value
)
{
checkClosed
();
parameterIndex
--;
ArrayList
<?
extends
ParameterInterface
>
parameters
=
command
.
getParameters
();
...
...
@@ -1505,7 +1505,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
return
getTraceObjectName
()
+
": "
+
command
;
}
protected
boolean
checkClosed
(
boolean
write
)
throws
SQLException
{
protected
boolean
checkClosed
(
boolean
write
)
{
if
(
super
.
checkClosed
(
write
))
{
// if the session was re-connected, re-prepare the statement
ArrayList
<?
extends
ParameterInterface
>
oldParams
=
command
.
getParameters
();
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
1538a750
...
...
@@ -2852,7 +2852,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
return
row
;
}
private
int
getColumnIndex
(
String
columnLabel
)
throws
SQLException
{
private
int
getColumnIndex
(
String
columnLabel
)
{
checkClosed
();
if
(
columnLabel
==
null
)
{
throw
DbException
.
getInvalidValueException
(
"columnLabel"
,
null
);
...
...
@@ -2912,7 +2912,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
DbException
.
get
(
ErrorCode
.
COLUMN_NOT_FOUND_1
,
columnLabel
);
}
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
private
void
checkColumnIndex
(
int
columnIndex
)
{
checkClosed
();
if
(
columnIndex
<
1
||
columnIndex
>
columnCount
)
{
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
);
...
...
@@ -2922,9 +2922,9 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
/**
* Check if this result set is closed.
*
* @throws
SQL
Exception if it is closed
* @throws
Db
Exception if it is closed
*/
void
checkClosed
()
throws
SQLException
{
void
checkClosed
()
{
if
(
result
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
}
...
...
@@ -2942,7 +2942,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
private
Value
get
(
int
columnIndex
)
throws
SQLException
{
private
Value
get
(
int
columnIndex
)
{
checkColumnIndex
(
columnIndex
);
checkOnValidRow
();
Value
[]
list
;
...
...
@@ -2959,17 +2959,17 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
return
value
;
}
private
Value
get
(
String
columnLabel
)
throws
SQLException
{
private
Value
get
(
String
columnLabel
)
{
int
columnIndex
=
getColumnIndex
(
columnLabel
);
return
get
(
columnIndex
);
}
private
void
update
(
String
columnLabel
,
Value
v
)
throws
SQLException
{
private
void
update
(
String
columnLabel
,
Value
v
)
{
int
columnIndex
=
getColumnIndex
(
columnLabel
);
update
(
columnIndex
,
v
);
}
private
void
update
(
int
columnIndex
,
Value
v
)
throws
SQLException
{
private
void
update
(
int
columnIndex
,
Value
v
)
{
checkUpdatable
();
checkColumnIndex
(
columnIndex
);
if
(
insertRow
!=
null
)
{
...
...
@@ -3473,12 +3473,12 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
private
Value
convertToUnknownValue
(
Object
x
)
throws
SQLException
{
private
Value
convertToUnknownValue
(
Object
x
)
{
checkClosed
();
return
DataType
.
convertToValue
(
conn
.
getSession
(),
x
,
Value
.
UNKNOWN
);
}
private
void
checkUpdatable
()
throws
SQLException
{
private
void
checkUpdatable
()
{
checkClosed
();
if
(!
updatable
)
{
throw
DbException
.
get
(
ErrorCode
.
RESULT_SET_READONLY
);
...
...
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
浏览文件 @
1538a750
...
...
@@ -413,7 +413,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
}
}
private
void
checkClosed
()
throws
SQLException
{
private
void
checkClosed
()
{
if
(
rs
!=
null
)
{
rs
.
checkClosed
();
}
...
...
@@ -422,7 +422,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
}
}
private
void
checkColumnIndex
(
int
columnIndex
)
throws
SQLException
{
private
void
checkColumnIndex
(
int
columnIndex
)
{
checkClosed
();
if
(
columnIndex
<
1
||
columnIndex
>
columnCount
)
{
throw
DbException
.
getInvalidValueException
(
"columnIndex"
,
columnIndex
);
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
1538a750
...
...
@@ -892,9 +892,9 @@ public class JdbcStatement extends TraceObject implements Statement {
* The next operation is a read request.
*
* @return true if the session was re-connected
* @throws
SQL
Exception if the connection or session is closed
* @throws
Db
Exception if the connection or session is closed
*/
boolean
checkClosed
()
throws
SQLException
{
boolean
checkClosed
()
{
return
checkClosed
(
false
);
}
...
...
@@ -903,9 +903,9 @@ public class JdbcStatement extends TraceObject implements Statement {
* The next operation may be a write request.
*
* @return true if the session was re-connected
* @throws
SQL
Exception if the connection or session is closed
* @throws
Db
Exception if the connection or session is closed
*/
boolean
checkClosedForWrite
()
throws
SQLException
{
boolean
checkClosedForWrite
()
{
return
checkClosed
(
true
);
}
...
...
@@ -915,9 +915,9 @@ public class JdbcStatement extends TraceObject implements Statement {
*
* @param write if the next operation is possibly writing
* @return true if a reconnect was required
* @throws
SQL
Exception if it is closed
* @throws
Db
Exception if it is closed
*/
protected
boolean
checkClosed
(
boolean
write
)
throws
SQLException
{
protected
boolean
checkClosed
(
boolean
write
)
{
if
(
conn
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
}
...
...
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
1538a750
...
...
@@ -452,7 +452,7 @@ public class JdbcXAConnection extends TraceObject implements XAConnection, XARes
return
isClosed
||
super
.
isClosed
();
}
protected
synchronized
void
checkClosed
(
boolean
write
)
throws
SQLException
{
protected
synchronized
void
checkClosed
(
boolean
write
)
{
if
(
isClosed
)
{
throw
DbException
.
get
(
ErrorCode
.
OBJECT_CLOSED
);
}
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
1538a750
...
...
@@ -469,7 +469,7 @@ public class TcpServer implements Service {
* @param sessionId the session id
* @param statementId the statement id
*/
void
cancelStatement
(
String
sessionId
,
int
statementId
)
throws
SQLException
{
void
cancelStatement
(
String
sessionId
,
int
statementId
)
{
for
(
TcpServerThread
c
:
New
.
arrayList
(
running
))
{
if
(
c
!=
null
)
{
c
.
cancelStatement
(
sessionId
,
statementId
);
...
...
@@ -484,9 +484,9 @@ public class TcpServer implements Service {
*
* @param db the key to test (or database name if no key is used)
* @return the database name
* @throws
SQL
Exception if a key is set but doesn't match
* @throws
Db
Exception if a key is set but doesn't match
*/
public
String
checkKeyAndGetDatabaseName
(
String
db
)
throws
SQLException
{
public
String
checkKeyAndGetDatabaseName
(
String
db
)
{
if
(
key
==
null
)
{
return
db
;
}
...
...
h2/src/main/org/h2/server/TcpServerThread.java
浏览文件 @
1538a750
...
...
@@ -215,7 +215,7 @@ public class TcpServerThread implements Runnable {
}
}
private
void
process
()
throws
IOException
,
SQLException
{
private
void
process
()
throws
IOException
{
int
operation
=
transfer
.
readInt
();
switch
(
operation
)
{
case
SessionRemote
.
SESSION_PREPARE_READ_PARAMS
:
...
...
@@ -402,7 +402,7 @@ public class TcpServerThread implements Runnable {
* @param targetSessionId the session id
* @param statementId the statement to cancel
*/
void
cancelStatement
(
String
targetSessionId
,
int
statementId
)
throws
SQLException
{
void
cancelStatement
(
String
targetSessionId
,
int
statementId
)
{
if
(
StringUtils
.
equals
(
targetSessionId
,
this
.
sessionId
))
{
Command
cmd
=
(
Command
)
cache
.
getObject
(
statementId
,
false
);
cmd
.
cancel
();
...
...
h2/src/main/org/h2/tools/DeleteDbFiles.java
浏览文件 @
1538a750
...
...
@@ -70,9 +70,8 @@ public class DeleteDbFiles extends Tool {
* @param dir the directory
* @param db the database name (null for all databases)
* @param quiet don't print progress information
* @throws SQLException
*/
public
static
void
execute
(
String
dir
,
String
db
,
boolean
quiet
)
throws
SQLException
{
public
static
void
execute
(
String
dir
,
String
db
,
boolean
quiet
)
{
new
DeleteDbFiles
().
process
(
dir
,
db
,
quiet
);
}
...
...
@@ -82,9 +81,8 @@ public class DeleteDbFiles extends Tool {
* @param dir the directory
* @param db the database name (null for all databases)
* @param quiet don't print progress information
* @throws SQLException
*/
private
void
process
(
String
dir
,
String
db
,
boolean
quiet
)
throws
SQLException
{
private
void
process
(
String
dir
,
String
db
,
boolean
quiet
)
{
ArrayList
<
String
>
files
=
FileLister
.
getDatabaseFiles
(
dir
,
db
,
true
);
if
(
files
.
size
()
==
0
&&
!
quiet
)
{
printNoDatabaseFilesFound
(
dir
,
db
);
...
...
h2/src/main/org/h2/tools/Restore.java
浏览文件 @
1538a750
...
...
@@ -132,9 +132,9 @@ public class Restore extends Tool {
* @param directory the directory name
* @param db the database name (null for all databases)
* @param quiet don't print progress information
* @throws
SQL
Exception
* @throws
DbException if there is an IO
Exception
*/
public
static
void
execute
(
String
zipFileName
,
String
directory
,
String
db
,
boolean
quiet
)
throws
SQLException
{
public
static
void
execute
(
String
zipFileName
,
String
directory
,
String
db
,
boolean
quiet
)
{
InputStream
in
=
null
;
try
{
if
(!
IOUtils
.
exists
(
zipFileName
))
{
...
...
h2/src/main/org/h2/util/SmallMap.java
浏览文件 @
1538a750
...
...
@@ -79,10 +79,10 @@ public class SmallMap {
* @param id the id of the object
* @param ifAvailable only return it if available, otherwise return null
* @return the object or null
* @throws
SQL
Exception if isAvailable is false and the object has not been
* @throws
Db
Exception if isAvailable is false and the object has not been
* found
*/
public
Object
getObject
(
int
id
,
boolean
ifAvailable
)
throws
SQLException
{
public
Object
getObject
(
int
id
,
boolean
ifAvailable
)
{
if
(
id
==
cacheId
)
{
return
cache
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论