Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
3ac7cad3
提交
3ac7cad3
authored
5月 30, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
catch Exception instead of Throwable
上级
f031fa50
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
516 行增加
和
473 行删除
+516
-473
Driver.java
h2/src/main/org/h2/Driver.java
+1
-1
JdbcArray.java
h2/src/main/org/h2/jdbc/JdbcArray.java
+20
-10
JdbcBlob.java
h2/src/main/org/h2/jdbc/JdbcBlob.java
+94
-65
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+3
-3
JdbcClob.java
h2/src/main/org/h2/jdbc/JdbcClob.java
+4
-4
JdbcConnection.java
h2/src/main/org/h2/jdbc/JdbcConnection.java
+55
-55
JdbcDatabaseMetaData.java
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
+25
-25
JdbcParameterMetaData.java
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
+9
-9
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+59
-59
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+164
-170
JdbcResultSetMetaData.java
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
+23
-22
JdbcSavepoint.java
h2/src/main/org/h2/jdbc/JdbcSavepoint.java
+2
-2
JdbcStatement.java
h2/src/main/org/h2/jdbc/JdbcStatement.java
+44
-44
JdbcConnectionPool.java
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
+1
-1
JdbcDataSourceFactory.java
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
+1
-1
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+10
-1
JdbcXid.java
h2/src/main/org/h2/jdbcx/JdbcXid.java
+1
-1
没有找到文件。
h2/src/main/org/h2/Driver.java
浏览文件 @
3ac7cad3
...
...
@@ -55,7 +55,7 @@ public class Driver implements java.sql.Driver {
return
null
;
}
return
new
JdbcConnection
(
url
,
info
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
Message
.
convert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcArray.java
浏览文件 @
3ac7cad3
...
...
@@ -42,13 +42,14 @@ public class JdbcArray extends TraceObject implements Array {
* This method always returns an Object[].
*
* @return the Object array
* @throws SQLException
*/
public
Object
getArray
()
throws
SQLException
{
try
{
debugCodeCall
(
"getArray"
);
checkClosed
();
return
get
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -59,6 +60,7 @@ public class JdbcArray extends TraceObject implements Array {
*
* @param map is ignored. Only empty or null maps are supported
* @return the Object array
* @throws SQLException
*/
public
Object
getArray
(
Map
map
)
throws
SQLException
{
try
{
...
...
@@ -66,7 +68,7 @@ public class JdbcArray extends TraceObject implements Array {
checkMap
(
map
);
checkClosed
();
return
get
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -79,13 +81,14 @@ public class JdbcArray extends TraceObject implements Array {
* @param index the start index of the subset (starting with 1)
* @param count the maximum number of values
* @return the Object array
* @throws SQLException
*/
public
Object
getArray
(
long
index
,
int
count
)
throws
SQLException
{
try
{
debugCode
(
"getArray("
+
index
+
", "
+
count
+
");"
);
checkClosed
();
return
get
(
index
,
count
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -99,6 +102,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param count the maximum number of values
* @param map is ignored. Only empty or null maps are supported
* @return the Object array
* @throws SQLException
*/
public
Object
getArray
(
long
index
,
int
count
,
Map
map
)
throws
SQLException
{
try
{
...
...
@@ -106,7 +110,7 @@ public class JdbcArray extends TraceObject implements Array {
checkClosed
();
checkMap
(
map
);
return
get
(
index
,
count
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -116,13 +120,14 @@ public class JdbcArray extends TraceObject implements Array {
* arrays and therefore there is no base type.
*
* @return Types.NULL
* @throws SQLException
*/
public
int
getBaseType
()
throws
SQLException
{
try
{
debugCodeCall
(
"getBaseType"
);
checkClosed
();
return
Types
.
NULL
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -132,13 +137,14 @@ public class JdbcArray extends TraceObject implements Array {
* type arrays and therefore there is no base type.
*
* @return "NULL"
* @throws SQLException
*/
public
String
getBaseTypeName
()
throws
SQLException
{
try
{
debugCodeCall
(
"getBaseTypeName"
);
checkClosed
();
return
"NULL"
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -149,13 +155,14 @@ public class JdbcArray extends TraceObject implements Array {
* (starting with 1) and the second column the value.
*
* @return the result set
* @throws SQLException
*/
public
ResultSet
getResultSet
()
throws
SQLException
{
try
{
debugCodeCall
(
"getResultSet"
);
checkClosed
();
return
getResultSet
(
get
(),
0
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -166,6 +173,7 @@ public class JdbcArray extends TraceObject implements Array {
*
* @param map is ignored. Only empty or null maps are supported
* @return the result set
* @throws SQLException
*/
public
ResultSet
getResultSet
(
Map
map
)
throws
SQLException
{
try
{
...
...
@@ -173,7 +181,7 @@ public class JdbcArray extends TraceObject implements Array {
checkClosed
();
checkMap
(
map
);
return
getResultSet
(
get
(),
0
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -187,13 +195,14 @@ public class JdbcArray extends TraceObject implements Array {
* @param index the start index of the subset (starting with 1)
* @param count the maximum number of values
* @return the result set
* @throws SQLException
*/
public
ResultSet
getResultSet
(
long
index
,
int
count
)
throws
SQLException
{
try
{
debugCode
(
"getResultSet("
+
index
+
", "
+
count
+
");"
);
checkClosed
();
return
getResultSet
(
get
(
index
,
count
),
index
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -209,6 +218,7 @@ public class JdbcArray extends TraceObject implements Array {
* @param count the maximum number of values
* @param map is ignored. Only empty or null maps are supported
* @return the result set
* @throws SQLException
*/
public
ResultSet
getResultSet
(
long
index
,
int
count
,
Map
map
)
throws
SQLException
{
try
{
...
...
@@ -216,7 +226,7 @@ public class JdbcArray extends TraceObject implements Array {
checkClosed
();
checkMap
(
map
);
return
getResultSet
(
get
(
index
,
count
),
index
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcBlob.java
浏览文件 @
3ac7cad3
...
...
@@ -6,6 +6,7 @@
*/
package
org
.
h2
.
jdbc
;
import
java.io.BufferedInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
...
...
@@ -41,6 +42,7 @@ public class JdbcBlob extends TraceObject implements Blob {
* Returns the length.
*
* @return the length
* @throws SQLException
*/
public
long
length
()
throws
SQLException
{
try
{
...
...
@@ -67,7 +69,7 @@ public class JdbcBlob extends TraceObject implements Blob {
in
.
close
();
}
return
size
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -76,6 +78,7 @@ public class JdbcBlob extends TraceObject implements Blob {
* [Not supported] Truncates the object.
*
* @param len the new length
* @throws SQLException
*/
public
void
truncate
(
long
len
)
throws
SQLException
{
debugCodeCall
(
"truncate"
,
len
);
...
...
@@ -88,6 +91,7 @@ public class JdbcBlob extends TraceObject implements Blob {
* @param pos the index, the first byte is at position 1
* @param length the number of bytes
* @return the bytes, at most length bytes
* @throws SQLException
*/
public
byte
[]
getBytes
(
long
pos
,
int
length
)
throws
SQLException
{
try
{
...
...
@@ -109,13 +113,18 @@ public class JdbcBlob extends TraceObject implements Blob {
in
.
close
();
}
return
out
.
toByteArray
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
/**
* [Not supported] Sets some bytes of the object.
*
* @param pos the write position
* @param bytes the bytes to set
* @return how many bytes have been written
* @throws SQLException
*/
public
int
setBytes
(
long
pos
,
byte
[]
bytes
)
throws
SQLException
{
debugCode
(
"setBytes("
+
pos
+
", bytes);"
);
...
...
@@ -124,6 +133,13 @@ public class JdbcBlob extends TraceObject implements Blob {
/**
* [Not supported] Sets some bytes of the object.
*
* @param pos the write position
* @param bytes the bytes to set
* @param offset the bytes offset
* @param len the number of bytes to write
* @return how many bytes have been written
* @throws SQLException
*/
public
int
setBytes
(
long
pos
,
byte
[]
bytes
,
int
offset
,
int
len
)
throws
SQLException
{
debugCode
(
"setBytes("
+
pos
+
", bytes, "
+
offset
+
", "
+
len
+
");"
);
...
...
@@ -134,19 +150,24 @@ public class JdbcBlob extends TraceObject implements Blob {
* Returns the input stream.
*
* @return the input stream
* @throws SQLException
*/
public
InputStream
getBinaryStream
()
throws
SQLException
{
try
{
debugCodeCall
(
"getBinaryStream"
);
checkClosed
();
return
value
.
getInputStream
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
/**
* [Not supported] Returns an output stream.
*
* @param pos where to start writing
* @return the output stream to write into
* @throws SQLException
*/
public
OutputStream
setBinaryStream
(
long
pos
)
throws
SQLException
{
debugCodeCall
(
"setBinaryStream"
,
pos
);
...
...
@@ -159,50 +180,51 @@ public class JdbcBlob extends TraceObject implements Blob {
* @param pattern the pattern to search
* @param start the index, the first byte is at position 1
* @return the position (first byte is at position 1), or -1 for not found
* @throws SQLException
*/
public
long
position
(
byte
[]
pattern
,
long
start
)
throws
SQLException
{
debugCode
(
"position(pattern, "
+
start
+
");"
);
if
(
false
)
{
try
{
debugCode
(
"position(pattern, "
+
start
+
");"
);
if
(
pattern
==
null
)
{
return
-
1
;
}
if
(
pattern
.
length
==
0
)
{
return
1
;
}
// TODO performance: blob pattern search is slow
BufferedInputStream
in
=
new
BufferedInputStream
(
value
.
getInputStream
());
IOUtils
.
skipFully
(
in
,
start
-
1
);
int
pos
=
0
;
int
patternPos
=
0
;
while
(
true
)
{
int
x
=
in
.
read
();
if
(
x
<
0
)
{
break
;
}
if
(
x
==
(
pattern
[
patternPos
]
&
0xff
))
{
if
(
patternPos
==
0
)
{
in
.
mark
(
pattern
.
length
);
}
if
(
patternPos
==
pattern
.
length
)
{
return
pos
-
patternPos
;
}
patternPos
++;
}
else
{
if
(
patternPos
>
0
)
{
in
.
reset
();
pos
-=
patternPos
;
}
}
pos
++;
}
return
-
1
;
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
throw
Message
.
getUnsupportedException
();
// TODO test
// try {
// debugCode("position(pattern, "+start+");");
// if(pattern == null) {
// return -1;
// }
// if(pattern.length == 0) {
// return 1;
// }
// // TODO performance: blob pattern search is slow
// BufferedInputStream in =
// new BufferedInputStream(value.getInputStream());
// IOUtils.skipFully(in, start - 1);
// int pos = 0;
// int patternPos = 0;
// while(true) {
// int x = in.read();
// if(x<0) {
// break;
// }
// if(x == (pattern[patternPos] & 0xff)) {
// if(patternPos == 0) {
// in.mark(pattern.length);
// }
// if(patternPos == pattern.length) {
// return pos - patternPos;
// }
// patternPos++;
// } else {
// if(patternPos > 0) {
// in.reset();
// pos -= patternPos;
// }
// }
// pos++;
// }
// return -1;
// } catch(Throwable e) {
// throw logAndConvert(e);
// }
}
/**
...
...
@@ -211,31 +233,33 @@ public class JdbcBlob extends TraceObject implements Blob {
* @param blobPattern the pattern to search
* @param start the index, the first byte is at position 1
* @return the position (first byte is at position 1), or -1 for not found
* @throws SQLException
*/
public
long
position
(
Blob
blobPattern
,
long
start
)
throws
SQLException
{
debugCode
(
"position(blobPattern, "
+
start
+
");"
);
throw
Message
.
getUnsupportedException
();
// try {
// debugCode("position(blobPattern, "+start+");");
// if(blobPattern == null) {
// return -1;
// }
// ByteArrayOutputStream out = new ByteArrayOutputStream();
// InputStream in = blobPattern.getBinaryStream();
// while(true) {
// int x = in.read();
// if(x < 0) {
// break;
// }
// out.write(x);
// }
// return position(out.toByteArray(), start);
// } catch(Throwable e) {
// throw logAndConvert(e);
// }
debugCode
(
"position(blobPattern, "
+
start
+
");"
);
if
(
false
)
{
try
{
debugCode
(
"position(blobPattern, "
+
start
+
");"
);
if
(
blobPattern
==
null
)
{
return
-
1
;
}
ByteArrayOutputStream
out
=
new
ByteArrayOutputStream
();
InputStream
in
=
blobPattern
.
getBinaryStream
();
while
(
true
)
{
int
x
=
in
.
read
();
if
(
x
<
0
)
{
break
;
}
out
.
write
(
x
);
}
return
position
(
out
.
toByteArray
(),
start
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
throw
Message
.
getUnsupportedException
();
}
/**
* Release all resources of this object.
*/
...
...
@@ -246,6 +270,11 @@ public class JdbcBlob extends TraceObject implements Blob {
/**
* [Not supported] Returns the input stream, starting from an offset.
*
* @param pos where to start reading
* @param length the number of bytes that will be read
* @return the input stream to read
* @throws SQLException
*/
public
InputStream
getBinaryStream
(
long
pos
,
long
length
)
throws
SQLException
{
debugCode
(
"getBinaryStream("
+
pos
+
", "
+
length
+
");"
);
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
3ac7cad3
...
...
@@ -27,7 +27,6 @@ import java.sql.Timestamp;
import
java.util.Calendar
;
import
java.util.Map
;
import
org.h2.engine.SessionInterface
;
import
org.h2.message.Message
;
import
org.h2.message.TraceObject
;
...
...
@@ -37,8 +36,9 @@ import org.h2.message.TraceObject;
*/
public
class
JdbcCallableStatement
extends
JdbcPreparedStatement
implements
CallableStatement
{
JdbcCallableStatement
(
SessionInterface
session
,
JdbcConnection
conn
,
String
sql
,
int
resultSetType
,
int
id
)
throws
SQLException
{
super
(
session
,
conn
,
sql
,
resultSetType
,
id
,
false
);
JdbcCallableStatement
(
JdbcConnection
conn
,
String
sql
,
int
resultSetType
,
int
id
)
throws
SQLException
{
super
(
conn
,
sql
,
resultSetType
,
id
,
false
);
setTrace
(
session
.
getTrace
(),
TraceObject
.
CALLABLE_STATEMENT
,
id
);
}
...
...
h2/src/main/org/h2/jdbc/JdbcClob.java
浏览文件 @
3ac7cad3
...
...
@@ -76,7 +76,7 @@ public class JdbcClob extends TraceObject implements Clob
}
finally
{
in
.
close
();
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -100,7 +100,7 @@ public class JdbcClob extends TraceObject implements Clob
checkClosed
();
String
s
=
value
.
getString
();
return
IOUtils
.
getInputStream
(
s
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -123,7 +123,7 @@ public class JdbcClob extends TraceObject implements Clob
debugCodeCall
(
"getCharacterStream"
);
checkClosed
();
return
value
.
getReader
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -168,7 +168,7 @@ public class JdbcClob extends TraceObject implements Clob
reader
.
close
();
}
return
buff
.
toString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcConnection.java
浏览文件 @
3ac7cad3
...
...
@@ -118,7 +118,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
this
.
url
=
ci
.
getURL
();
openStackTrace
=
new
Exception
(
"Stack Trace"
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -149,8 +149,8 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeAssign
(
"Statement"
,
TraceObject
.
STATEMENT
,
id
,
"createStatement()"
);
}
checkClosed
();
return
new
JdbcStatement
(
session
,
this
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcStatement
(
this
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -170,8 +170,8 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeAssign
(
"Statement"
,
TraceObject
.
STATEMENT
,
id
,
"createStatement("
+
resultSetType
+
", "
+
resultSetConcurrency
+
")"
);
}
checkClosed
();
return
new
JdbcStatement
(
session
,
this
,
resultSetType
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcStatement
(
this
,
resultSetType
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -194,8 +194,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
checkHoldability
(
resultSetHoldability
);
return
new
JdbcStatement
(
session
,
this
,
resultSetType
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcStatement
(
this
,
resultSetType
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -215,8 +215,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
sql
=
translateSQL
(
sql
);
return
new
JdbcPreparedStatement
(
session
,
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcPreparedStatement
(
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -229,8 +229,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
sql
=
translateSQL
(
sql
);
return
new
JdbcPreparedStatement
(
session
,
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
true
);
}
catch
(
Throwable
e
)
{
return
new
JdbcPreparedStatement
(
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
,
true
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -250,7 +250,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
return
new
JdbcDatabaseMetaData
(
this
,
trace
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -322,7 +322,7 @@ public class JdbcConnection extends TraceObject implements Connection {
session
=
null
;
}
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -356,7 +356,7 @@ public class JdbcConnection extends TraceObject implements Connection {
setAutoCommitFalse
=
prepareCommand
(
"SET AUTOCOMMIT FALSE"
,
setAutoCommitFalse
);
setAutoCommitFalse
.
executeUpdate
();
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -373,7 +373,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
debugCodeCall
(
"getAutoCommit"
);
return
getInternalAutoCommit
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -400,7 +400,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
commit
=
prepareCommand
(
"COMMIT"
,
commit
);
commit
.
executeUpdate
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -417,7 +417,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall
(
"rollback"
);
checkClosed
();
rollbackInternal
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -431,7 +431,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try
{
debugCodeCall
(
"isClosed"
);
return
session
==
null
||
session
.
isClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -448,7 +448,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall
(
"nativeSQL"
,
sql
);
checkClosed
();
return
translateSQL
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -467,7 +467,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"setReadOnly("
+
readOnly
+
");"
);
}
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -488,7 +488,7 @@ public class JdbcConnection extends TraceObject implements Connection {
result
.
next
();
boolean
readOnly
=
result
.
currentRow
()[
0
].
getBoolean
().
booleanValue
();
return
readOnly
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -503,7 +503,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try
{
debugCodeCall
(
"setCatalog"
,
catalog
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -526,7 +526,7 @@ public class JdbcConnection extends TraceObject implements Connection {
cat
.
close
();
}
return
catalog
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -541,7 +541,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall
(
"getWarnings"
);
checkClosed
();
return
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -553,7 +553,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try
{
debugCodeCall
(
"clearWarnings"
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -575,8 +575,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
sql
=
translateSQL
(
sql
);
return
new
JdbcPreparedStatement
(
session
,
this
,
sql
,
resultSetType
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcPreparedStatement
(
this
,
sql
,
resultSetType
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -616,7 +616,7 @@ public class JdbcConnection extends TraceObject implements Connection {
setLockMode
=
prepareCommand
(
"SET LOCK_MODE ?"
,
setLockMode
);
((
ParameterInterface
)
setLockMode
.
getParameters
().
get
(
0
)).
setValue
(
ValueInt
.
get
(
lockMode
),
false
);
setLockMode
.
executeUpdate
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -629,7 +629,7 @@ public class JdbcConnection extends TraceObject implements Connection {
setQueryTimeout
=
prepareCommand
(
"SET QUERY_TIMEOUT ?"
,
setQueryTimeout
);
((
ParameterInterface
)
setQueryTimeout
.
getParameters
().
get
(
0
)).
setValue
(
ValueInt
.
get
(
seconds
*
1000
),
false
);
setQueryTimeout
.
executeUpdate
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -650,7 +650,7 @@ public class JdbcConnection extends TraceObject implements Connection {
}
// round to the next second, otherwise 999 millis would return 0 seconds
return
(
queryTimeout
+
999
)
/
1000
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
...
...
@@ -687,7 +687,7 @@ public class JdbcConnection extends TraceObject implements Connection {
throw
Message
.
getInternalError
(
"lockMode:"
+
lockMode
);
}
return
transactionIsolationLevel
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -708,7 +708,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
checkHoldability
(
holdability
);
this
.
holdability
=
holdability
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -724,7 +724,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall
(
"getHoldability"
);
checkClosed
();
return
holdability
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -741,7 +741,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall
(
"getTypeMap"
);
checkClosed
();
return
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -754,7 +754,7 @@ public class JdbcConnection extends TraceObject implements Connection {
try
{
debugCode
(
"setTypeMap("
+
quoteMap
(
map
)
+
");"
);
checkMap
(
map
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -774,8 +774,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
sql
=
translateSQL
(
sql
);
return
new
JdbcCallableStatement
(
session
,
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
);
}
catch
(
Throwable
e
)
{
return
new
JdbcCallableStatement
(
this
,
sql
,
ResultSet
.
TYPE_FORWARD_ONLY
,
id
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -797,8 +797,8 @@ public class JdbcConnection extends TraceObject implements Connection {
}
checkClosed
();
sql
=
translateSQL
(
sql
);
return
new
JdbcCallableStatement
(
session
,
this
,
sql
,
resultSetType
,
id
);
}
catch
(
Throwable
e
)
{
return
new
JdbcCallableStatement
(
this
,
sql
,
resultSetType
,
id
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -824,8 +824,8 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
checkHoldability
(
resultSetHoldability
);
sql
=
translateSQL
(
sql
);
return
new
JdbcCallableStatement
(
session
,
this
,
sql
,
resultSetType
,
id
);
}
catch
(
Throwable
e
)
{
return
new
JdbcCallableStatement
(
this
,
sql
,
resultSetType
,
id
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -848,7 +848,7 @@ public class JdbcConnection extends TraceObject implements Connection {
JdbcSavepoint
savepoint
=
new
JdbcSavepoint
(
this
,
savepointId
,
null
,
trace
,
id
);
savepointId
++;
return
savepoint
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -871,7 +871,7 @@ public class JdbcConnection extends TraceObject implements Connection {
set
.
executeUpdate
();
JdbcSavepoint
savepoint
=
new
JdbcSavepoint
(
this
,
0
,
name
,
trace
,
id
);
return
savepoint
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -887,7 +887,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"rollback("
+
sp
.
getTraceObjectName
()
+
");"
);
checkClosed
();
sp
.
rollback
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -902,7 +902,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"releaseSavepoint(savepoint);"
);
checkClosed
();
convertSavepoint
(
savepoint
).
release
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -934,8 +934,8 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
checkHoldability
(
resultSetHoldability
);
sql
=
translateSQL
(
sql
);
return
new
JdbcPreparedStatement
(
session
,
this
,
sql
,
resultSetType
,
id
,
false
);
}
catch
(
Throwable
e
)
{
return
new
JdbcPreparedStatement
(
this
,
sql
,
resultSetType
,
id
,
false
);
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -954,7 +954,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"prepareStatement("
+
quote
(
sql
)
+
", "
+
autoGeneratedKeys
+
");"
);
}
return
prepareStatement
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -973,7 +973,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"prepareStatement("
+
quote
(
sql
)
+
", "
+
quoteIntArray
(
columnIndexes
)
+
");"
);
}
return
prepareStatement
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -992,7 +992,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCode
(
"prepareStatement("
+
quote
(
sql
)
+
", "
+
quoteArray
(
columnNames
)
+
");"
);
}
return
prepareStatement
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1006,7 +1006,7 @@ public class JdbcConnection extends TraceObject implements Connection {
Class
clazz
=
java
.
sql
.
Savepoint
.
class
;
clazz
.
getClass
();
//## Java 1.4 end ##
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
Message
.
getSQLException
(
ErrorCode
.
UNSUPPORTED_JAVA_VERSION
);
}
}
...
...
@@ -1297,7 +1297,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
ValueLob
v
=
ValueLob
.
createSmallLob
(
Value
.
CLOB
,
new
byte
[
0
]);
return
new
JdbcClob
(
session
,
this
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1314,7 +1314,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
ValueLob
v
=
ValueLob
.
createSmallLob
(
Value
.
BLOB
,
new
byte
[
0
]);
return
new
JdbcBlob
(
session
,
this
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1332,7 +1332,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed();
ValueLob v = ValueLob.createSmallLob(Value.CLOB, new byte[0]);
return new JdbcClob(session, this, v, id);
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -1378,7 +1378,7 @@ public class JdbcConnection extends TraceObject implements Connection {
checkClosed
();
getInternalAutoCommit
();
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
// this method doesn't throw an exception, but it logs it
logAndConvert
(
e
);
return
false
;
...
...
h2/src/main/org/h2/jdbc/JdbcDatabaseMetaData.java
浏览文件 @
3ac7cad3
...
...
@@ -159,7 +159,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
4
+
i
,
types
[
i
]);
}
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -241,7 +241,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
3
,
getPattern
(
tableNamePattern
));
prep
.
setString
(
4
,
getPattern
(
columnNamePattern
));
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -319,7 +319,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schema
));
prep
.
setString
(
3
,
tableName
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -369,7 +369,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schema
));
prep
.
setString
(
3
,
tableName
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -403,7 +403,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
try
{
debugCodeCall
(
"getURL"
);
return
conn
.
getURL
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -418,7 +418,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
try
{
debugCodeCall
(
"getUserName"
);
return
conn
.
getUser
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -432,7 +432,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
try
{
debugCodeCall
(
"isReadOnly"
);
return
conn
.
isReadOnly
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -538,7 +538,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schemaPattern
));
prep
.
setString
(
3
,
getPattern
(
procedureNamePattern
));
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -600,7 +600,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
3
,
getPattern
(
procedureNamePattern
));
prep
.
setString
(
4
,
getPattern
(
columnNamePattern
));
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -630,7 +630,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"FROM INFORMATION_SCHEMA.SCHEMATA "
+
"ORDER BY SCHEMA_NAME"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -654,7 +654,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
"SELECT CATALOG_NAME TABLE_CAT "
+
"FROM INFORMATION_SCHEMA.CATALOGS"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -680,7 +680,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"FROM INFORMATION_SCHEMA.TABLE_TYPES "
+
"ORDER BY TABLE_TYPE"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -742,7 +742,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
3
,
table
);
prep
.
setString
(
4
,
getPattern
(
columnNamePattern
));
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -797,7 +797,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schemaPattern
));
prep
.
setString
(
3
,
getPattern
(
tableNamePattern
));
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -862,7 +862,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
4
,
getSchemaPattern
(
schema
));
prep
.
setString
(
5
,
tableName
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -909,7 +909,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"FROM INFORMATION_SCHEMA.COLUMNS "
+
"WHERE FALSE"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -978,7 +978,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schema
));
prep
.
setString
(
3
,
tableName
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1048,7 +1048,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
2
,
getSchemaPattern
(
schema
));
prep
.
setString
(
3
,
tableName
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1134,7 +1134,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
prep
.
setString
(
5
,
getSchemaPattern
(
foreignSchema
));
prep
.
setString
(
6
,
foreignTable
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1182,7 +1182,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"FROM INFORMATION_SCHEMA.CATALOGS "
+
"WHERE FALSE"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1244,7 +1244,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"ORDER BY DATA_TYPE, POS"
);
ResultSet
rs
=
prep
.
executeQuery
();
return
rs
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1356,7 +1356,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
rs
.
close
();
prep
.
close
();
return
buff
.
toString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2463,7 +2463,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
quote
(
typeNamePattern
)+
");"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2499,7 +2499,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
"FROM INFORMATION_SCHEMA.CATALOGS "
+
"WHERE FALSE"
);
return
prep
.
executeQuery
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2519,7 +2519,7 @@ public class JdbcDatabaseMetaData extends TraceObject implements DatabaseMetaDat
+
quote
(
attributeNamePattern
)+
");"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcParameterMetaData.java
浏览文件 @
3ac7cad3
...
...
@@ -49,7 +49,7 @@ implements ParameterMetaData
debugCodeCall
(
"getParameterCount"
);
checkClosed
();
return
paramCount
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -67,7 +67,7 @@ implements ParameterMetaData
debugCodeCall
(
"getParameterMode"
,
param
);
getParameter
(
param
);
return
parameterModeIn
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -89,7 +89,7 @@ implements ParameterMetaData
type
=
Value
.
STRING
;
}
return
DataType
.
getDataType
(
type
).
sqlType
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -106,7 +106,7 @@ implements ParameterMetaData
debugCodeCall
(
"getPrecision"
,
param
);
ParameterInterface
p
=
getParameter
(
param
);
return
MathUtils
.
convertLongToInt
(
p
.
getPrecision
());
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -123,7 +123,7 @@ implements ParameterMetaData
debugCodeCall
(
"getScale"
,
param
);
ParameterInterface
p
=
getParameter
(
param
);
return
p
.
getScale
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -139,7 +139,7 @@ implements ParameterMetaData
try
{
debugCodeCall
(
"isNullable"
,
param
);
return
getParameter
(
param
).
getNullable
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -156,7 +156,7 @@ implements ParameterMetaData
debugCodeCall
(
"isSigned"
,
param
);
getParameter
(
param
);
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -177,7 +177,7 @@ implements ParameterMetaData
type
=
Value
.
STRING
;
}
return
DataType
.
getTypeClassName
(
type
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -198,7 +198,7 @@ implements ParameterMetaData
type
=
Value
.
STRING
;
}
return
DataType
.
getDataType
(
type
).
name
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
3ac7cad3
...
...
@@ -26,7 +26,6 @@ import java.util.Calendar;
import
org.h2.command.CommandInterface
;
import
org.h2.constant.ErrorCode
;
import
org.h2.engine.SessionInterface
;
import
org.h2.expression.ParameterInterface
;
import
org.h2.message.Message
;
import
org.h2.message.TraceObject
;
...
...
@@ -66,8 +65,9 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
private
CommandInterface
command
;
private
ObjectArray
batchParameters
;
JdbcPreparedStatement
(
SessionInterface
session
,
JdbcConnection
conn
,
String
sql
,
int
resultSetType
,
int
id
,
boolean
closeWithResultSet
)
throws
SQLException
{
super
(
session
,
conn
,
resultSetType
,
id
,
closeWithResultSet
);
JdbcPreparedStatement
(
JdbcConnection
conn
,
String
sql
,
int
resultSetType
,
int
id
,
boolean
closeWithResultSet
)
throws
SQLException
{
super
(
conn
,
resultSetType
,
id
,
closeWithResultSet
);
setTrace
(
session
.
getTrace
(),
TraceObject
.
PREPARED_STATEMENT
,
id
);
command
=
conn
.
prepareCommand
(
sql
,
fetchSize
);
}
...
...
@@ -98,9 +98,9 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
setExecutingStatement
(
null
);
}
}
resultSet
=
new
JdbcResultSet
(
session
,
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
return
resultSet
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -124,7 +124,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCodeCall
(
"executeUpdate"
);
checkClosed
();
return
executeUpdateInternal
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -167,7 +167,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
returnsResultSet
=
true
;
boolean
scrollable
=
resultSetType
!=
ResultSet
.
TYPE_FORWARD_ONLY
;
ResultInterface
result
=
command
.
executeQuery
(
maxRows
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
session
,
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
}
else
{
returnsResultSet
=
false
;
updateCount
=
command
.
executeUpdate
();
...
...
@@ -177,7 +177,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
}
return
returnsResultSet
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -197,7 +197,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
// can only delete old temp files if they are not in the batch
param
.
setValue
(
null
,
batchParameters
==
null
);
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -211,7 +211,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
try
{
debugCodeCall
(
"executeQuery"
,
sql
);
throw
Message
.
getSQLException
(
ErrorCode
.
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -225,7 +225,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
try
{
debugCodeCall
(
"addBatch"
,
sql
);
throw
Message
.
getSQLException
(
ErrorCode
.
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -239,7 +239,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
try
{
debugCodeCall
(
"executeUpdate"
,
sql
);
throw
Message
.
getSQLException
(
ErrorCode
.
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -253,7 +253,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
try
{
debugCodeCall
(
"execute"
,
sql
);
throw
Message
.
getSQLException
(
ErrorCode
.
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -273,7 +273,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setNull("
+
parameterIndex
+
", "
+
sqlType
+
");"
);
}
setParameter
(
parameterIndex
,
ValueNull
.
INSTANCE
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -291,7 +291,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setInt("
+
parameterIndex
+
", "
+
x
+
");"
);
}
setParameter
(
parameterIndex
,
ValueInt
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -310,7 +310,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -329,7 +329,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDecimal
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -348,7 +348,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDate
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -367,7 +367,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTime
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -386,7 +386,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTimestamp
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -409,7 +409,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
else
{
setParameter
(
parameterIndex
,
DataType
.
convertToValue
(
session
,
x
,
Value
.
UNKNOWN
));
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -435,7 +435,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
Value
v
=
DataType
.
convertToValue
(
session
,
x
,
type
);
setParameter
(
parameterIndex
,
v
.
convertTo
(
type
));
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -456,7 +456,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setObject("
+
parameterIndex
+
", x, "
+
targetSqlType
+
", "
+
scale
+
");"
);
}
setObject
(
parameterIndex
,
x
,
targetSqlType
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -474,7 +474,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setBoolean("
+
parameterIndex
+
", "
+
x
+
");"
);
}
setParameter
(
parameterIndex
,
ValueBoolean
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -492,7 +492,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setByte("
+
parameterIndex
+
", "
+
x
+
");"
);
}
setParameter
(
parameterIndex
,
ValueByte
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -510,7 +510,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setShort("
+
parameterIndex
+
", (short) "
+
x
+
");"
);
}
setParameter
(
parameterIndex
,
ValueShort
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -528,7 +528,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setLong("
+
parameterIndex
+
", "
+
x
+
"L);"
);
}
setParameter
(
parameterIndex
,
ValueLong
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -546,7 +546,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setFloat("
+
parameterIndex
+
", "
+
x
+
"f);"
);
}
setParameter
(
parameterIndex
,
ValueFloat
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -564,7 +564,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setDouble("
+
parameterIndex
+
", "
+
x
+
"d);"
);
}
setParameter
(
parameterIndex
,
ValueDouble
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -578,7 +578,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setRef("
+
parameterIndex
+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -602,7 +602,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
else
{
setParameter
(
parameterIndex
,
DateTimeUtils
.
convertDateToUniversal
(
x
,
calendar
));
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -626,7 +626,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
else
{
setParameter
(
parameterIndex
,
DateTimeUtils
.
convertTimeToUniversal
(
x
,
calendar
));
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -650,7 +650,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
else
{
setParameter
(
parameterIndex
,
DateTimeUtils
.
convertTimestampToUniversal
(
x
,
calendar
));
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -665,7 +665,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setUnicodeStream("
+
parameterIndex
+
", x, "
+
length
+
");"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -684,7 +684,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setNull("
+
parameterIndex
+
", "
+
sqlType
+
", "
+
quote
(
typeName
)+
");"
);
}
setNull
(
parameterIndex
,
sqlType
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -709,7 +709,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
v
=
conn
.
createBlob
(
x
.
getBinaryStream
(),
-
1
);
}
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -729,7 +729,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
-
1
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -754,7 +754,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
v
=
conn
.
createClob
(
x
.
getCharacterStream
(),
-
1
);
}
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -779,7 +779,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
v
=
conn
.
createClob
(
x
,
-
1
);
}
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -793,7 +793,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setArray("
+
parameterIndex
+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -812,7 +812,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueBytes
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -833,7 +833,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -889,7 +889,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
IOUtils
.
getAsciiReader
(
x
),
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -944,7 +944,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -958,7 +958,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"setURL("
+
parameterIndex
+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -985,7 +985,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
String
catalog
=
conn
.
getCatalog
();
JdbcResultSetMetaData
meta
=
new
JdbcResultSetMetaData
(
null
,
this
,
result
,
catalog
,
session
.
getTrace
(),
id
);
return
meta
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -998,7 +998,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCodeCall
(
"clearBatch"
);
checkClosed
();
batchParameters
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1016,7 +1016,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
command
.
close
();
command
=
null
;
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1068,7 +1068,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
throw
e
;
}
return
result
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1091,7 +1091,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
batchParameters
=
new
ObjectArray
();
}
batchParameters
.
add
(
set
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1107,7 +1107,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
debugCode
(
"executeUpdate("
+
quote
(
sql
)+
", "
+
autoGeneratedKeys
+
");"
);
}
throw
Message
.
getSQLException
(
ErrorCode
.
METHOD_NOT_ALLOWED_FOR_PREPARED_STATEMENT
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1208,7 +1208,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
JdbcParameterMetaData
meta
=
new
JdbcParameterMetaData
(
session
,
this
,
command
,
id
);
return
meta
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1251,7 +1251,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
}
Value
v
=
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1272,7 +1272,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1309,7 +1309,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
v = conn.createClob(x.getCharacterStream(), -1);
}
setParameter(parameterIndex, v);
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -1330,7 +1330,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
-
1
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1350,7 +1350,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1370,7 +1370,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1390,7 +1390,7 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
setParameter
(
parameterIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
3ac7cad3
...
...
@@ -81,9 +81,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
private
Value
[]
updateRow
;
private
HashMap
columnNameMap
;
JdbcResultSet
(
SessionInterface
session
,
JdbcConnection
conn
,
JdbcStatement
stat
,
ResultInterface
result
,
int
id
,
boolean
closeStatement
,
boolean
scrollable
)
{
JdbcResultSet
(
JdbcConnection
conn
,
JdbcStatement
stat
,
ResultInterface
result
,
int
id
,
boolean
closeStatement
,
boolean
scrollable
)
{
this
.
session
=
conn
.
getSession
();
setTrace
(
session
.
getTrace
(),
TraceObject
.
RESULT_SET
,
id
);
this
.
session
=
session
;
this
.
conn
=
conn
;
this
.
stat
=
stat
;
this
.
result
=
result
;
...
...
@@ -102,7 +103,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"next"
);
checkClosed
();
return
nextRow
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -122,7 +123,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
String
catalog
=
conn
.
getCatalog
();
JdbcResultSetMetaData
meta
=
new
JdbcResultSetMetaData
(
this
,
null
,
result
,
catalog
,
session
.
getTrace
(),
id
);
return
meta
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -137,7 +138,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"wasNull"
);
checkClosed
();
return
wasNull
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -155,7 +156,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"findColumn"
,
columnName
);
return
getColumnIndex
(
columnName
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -167,7 +168,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"close"
);
closeInternal
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -205,7 +206,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
return
null
;
}
return
stat
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -220,7 +221,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getWarnings"
);
checkClosed
();
return
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -232,7 +233,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"clearWarnings"
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -250,7 +251,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getString"
,
columnIndex
);
return
get
(
columnIndex
).
getString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -266,7 +267,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getString"
,
columnName
);
return
get
(
columnName
).
getString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -282,7 +283,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getInt"
,
columnIndex
);
return
get
(
columnIndex
).
getInt
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -298,7 +299,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getInt"
,
columnName
);
return
get
(
columnName
).
getInt
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -314,7 +315,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBigDecimal"
,
columnIndex
);
return
get
(
columnIndex
).
getBigDecimal
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -330,7 +331,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getDate"
,
columnIndex
);
return
get
(
columnIndex
).
getDate
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -346,7 +347,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getTime"
,
columnIndex
);
return
get
(
columnIndex
).
getTime
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -362,7 +363,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getTimestamp"
,
columnIndex
);
return
get
(
columnIndex
).
getTimestamp
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -378,7 +379,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBigDecimal"
,
columnName
);
return
get
(
columnName
).
getBigDecimal
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -394,7 +395,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getDate"
,
columnName
);
return
get
(
columnName
).
getDate
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -410,7 +411,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getTime"
,
columnName
);
return
get
(
columnName
).
getTime
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -426,7 +427,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getTimestamp"
,
columnName
);
return
get
(
columnName
).
getTimestamp
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -450,7 +451,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
return
v
.
getObject
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -474,7 +475,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
return
v
.
getObject
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -492,7 +493,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getBoolean"
,
columnIndex
);
Boolean
v
=
get
(
columnIndex
).
getBoolean
();
return
v
==
null
?
false
:
v
.
booleanValue
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -510,7 +511,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getBoolean"
,
columnName
);
Boolean
v
=
get
(
columnName
).
getBoolean
();
return
v
==
null
?
false
:
v
.
booleanValue
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -527,7 +528,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getByte"
,
columnIndex
);
return
get
(
columnIndex
).
getByte
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -544,7 +545,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getByte"
,
columnName
);
return
get
(
columnName
).
getByte
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -561,7 +562,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getShort"
,
columnIndex
);
return
get
(
columnIndex
).
getShort
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -578,7 +579,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getShort"
,
columnName
);
return
get
(
columnName
).
getShort
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -595,7 +596,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getLong"
,
columnIndex
);
return
get
(
columnIndex
).
getLong
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -612,7 +613,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getLong"
,
columnName
);
return
get
(
columnName
).
getLong
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -629,7 +630,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getFloat"
,
columnIndex
);
return
get
(
columnIndex
).
getFloat
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -646,7 +647,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getFloat"
,
columnName
);
return
get
(
columnName
).
getFloat
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -663,7 +664,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getDouble"
,
columnIndex
);
return
get
(
columnIndex
).
getDouble
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -680,7 +681,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getDouble"
,
columnName
);
return
get
(
columnName
).
getDouble
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -705,7 +706,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
BigDecimal
bd
=
get
(
columnName
).
getBigDecimal
();
return
bd
==
null
?
null
:
MathUtils
.
setScale
(
bd
,
scale
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -730,7 +731,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
BigDecimal
bd
=
get
(
columnIndex
).
getBigDecimal
();
return
bd
==
null
?
null
:
MathUtils
.
setScale
(
bd
,
scale
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -743,7 +744,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getUnicodeStream"
,
columnIndex
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -756,7 +757,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getUnicodeStream"
,
columnName
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -771,7 +772,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"getObject("
+
columnIndex
+
", map);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -786,7 +787,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"getObject("
+
quote
(
columnName
)
+
", map);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -798,7 +799,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getRef"
,
columnIndex
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -810,7 +811,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getRef"
,
columnName
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -832,7 +833,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Date
x
=
get
(
columnIndex
).
getDate
();
return
DateTimeUtils
.
convertDateToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -854,7 +855,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Date
x
=
get
(
columnName
).
getDate
();
return
DateTimeUtils
.
convertDateToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -876,7 +877,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Time
x
=
get
(
columnIndex
).
getTime
();
return
DateTimeUtils
.
convertTimeToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -898,7 +899,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Time
x
=
get
(
columnName
).
getTime
();
return
DateTimeUtils
.
convertTimeToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -920,7 +921,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Timestamp
x
=
get
(
columnIndex
).
getTimestamp
();
return
DateTimeUtils
.
convertTimestampToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -941,7 +942,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
Timestamp
x
=
get
(
columnName
).
getTimestamp
();
return
DateTimeUtils
.
convertTimestampToCalendar
(
x
,
calendar
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -960,7 +961,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Blob"
,
TraceObject
.
BLOB
,
id
,
"getBlob("
+
columnIndex
+
")"
);
Value
v
=
get
(
columnIndex
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcBlob
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -979,7 +980,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Blob"
,
TraceObject
.
BLOB
,
id
,
"getBlob("
+
quote
(
columnName
)
+
")"
);
Value
v
=
get
(
columnName
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcBlob
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -996,7 +997,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBytes"
,
columnIndex
);
return
get
(
columnIndex
).
getBytes
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1013,7 +1014,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBytes"
,
columnName
);
return
get
(
columnName
).
getBytes
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1030,7 +1031,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBinaryStream"
,
columnIndex
);
return
get
(
columnIndex
).
getInputStream
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1047,7 +1048,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getBinaryStream"
,
columnName
);
return
get
(
columnName
).
getInputStream
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1067,7 +1068,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Clob"
,
TraceObject
.
CLOB
,
id
,
"getClob("
+
columnIndex
+
")"
);
Value
v
=
get
(
columnIndex
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcClob
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1086,7 +1087,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Clob"
,
TraceObject
.
CLOB
,
id
,
"getClob("
+
quote
(
columnName
)
+
")"
);
Value
v
=
get
(
columnName
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcClob
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1105,7 +1106,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Clob"
,
TraceObject
.
ARRAY
,
id
,
"getArray("
+
columnIndex
+
")"
);
Value
v
=
get
(
columnIndex
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcArray
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1124,7 +1125,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign
(
"Clob"
,
TraceObject
.
ARRAY
,
id
,
"getArray("
+
quote
(
columnName
)
+
")"
);
Value
v
=
get
(
columnName
);
return
v
==
ValueNull
.
INSTANCE
?
null
:
new
JdbcArray
(
session
,
conn
,
v
,
id
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1143,7 +1144,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
String
s
=
get
(
columnIndex
).
getString
();
// TODO ascii stream: convert the reader to a ascii stream
return
s
==
null
?
null
:
IOUtils
.
getInputStream
(
s
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1162,7 +1163,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
String
s
=
get
(
columnName
).
getString
();
// TODO ascii stream: convert the reader to a ascii stream
return
IOUtils
.
getInputStream
(
s
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1179,7 +1180,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getCharacterStream"
,
columnIndex
);
return
get
(
columnIndex
).
getReader
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1196,7 +1197,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getCharacterStream"
,
columnName
);
return
get
(
columnName
).
getReader
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1208,7 +1209,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getURL"
,
columnIndex
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1220,7 +1221,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getURL"
,
columnName
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1237,7 +1238,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"updateNull"
,
columnIndex
);
update
(
columnIndex
,
ValueNull
.
INSTANCE
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1252,7 +1253,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"updateNull"
,
columnName
);
update
(
columnName
,
ValueNull
.
INSTANCE
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1270,7 +1271,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBoolean("
+
columnIndex
+
", "
+
x
+
");"
);
}
update
(
columnIndex
,
ValueBoolean
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1288,7 +1289,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBoolean("
+
quote
(
columnName
)+
", "
+
x
+
");"
);
}
update
(
columnName
,
ValueBoolean
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1306,7 +1307,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateByte("
+
columnIndex
+
", "
+
x
+
");"
);
}
update
(
columnIndex
,
ValueByte
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1324,7 +1325,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateByte("
+
columnName
+
", "
+
x
+
");"
);
}
update
(
columnName
,
ValueByte
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1342,7 +1343,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBytes("
+
columnIndex
+
", x);"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueBytes
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1360,7 +1361,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBytes("
+
quote
(
columnName
)+
", x);"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueBytes
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1378,7 +1379,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateShort("
+
columnIndex
+
", (short) "
+
x
+
");"
);
}
update
(
columnIndex
,
ValueShort
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1396,7 +1397,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateShort("
+
quote
(
columnName
)+
", (short) "
+
x
+
");"
);
}
update
(
columnName
,
ValueShort
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1414,7 +1415,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateInt("
+
columnIndex
+
", "
+
x
+
");"
);
}
update
(
columnIndex
,
ValueInt
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1432,7 +1433,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateInt("
+
quote
(
columnName
)+
", "
+
x
+
");"
);
}
update
(
columnName
,
ValueInt
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1450,7 +1451,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateLong("
+
columnIndex
+
", "
+
x
+
"L);"
);
}
update
(
columnIndex
,
ValueLong
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1468,7 +1469,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateLong("
+
quote
(
columnName
)+
", "
+
x
+
"L);"
);
}
update
(
columnName
,
ValueLong
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1486,7 +1487,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateFloat("
+
columnIndex
+
", "
+
x
+
"f);"
);
}
update
(
columnIndex
,
ValueFloat
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1504,7 +1505,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateFloat("
+
quote
(
columnName
)+
", "
+
x
+
"f);"
);
}
update
(
columnName
,
ValueFloat
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1522,7 +1523,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateDouble("
+
columnIndex
+
", "
+
x
+
"d);"
);
}
update
(
columnIndex
,
ValueDouble
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1540,7 +1541,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateDouble("
+
quote
(
columnName
)+
", "
+
x
+
"d);"
);
}
update
(
columnName
,
ValueDouble
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1558,7 +1559,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBigDecimal("
+
columnIndex
+
", "
+
quoteBigDecimal
(
x
)
+
");"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDecimal
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1576,7 +1577,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateBigDecimal("
+
quote
(
columnName
)+
", "
+
quoteBigDecimal
(
x
)
+
");"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDecimal
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1594,7 +1595,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateString("
+
columnIndex
+
", "
+
quote
(
x
)+
");"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1612,7 +1613,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateString("
+
quote
(
columnName
)+
", "
+
quote
(
x
)+
");"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1630,7 +1631,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateDate("
+
columnIndex
+
", x);"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDate
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1648,7 +1649,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateDate("
+
quote
(
columnName
)+
", x);"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueDate
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1666,7 +1667,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateTime("
+
columnIndex
+
", x);"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTime
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1684,7 +1685,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateTime("
+
quote
(
columnName
)+
", x);"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTime
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1702,7 +1703,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateTimestamp("
+
columnIndex
+
", x);"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTimestamp
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1720,7 +1721,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateTimestamp("
+
quote
(
columnName
)+
", x);"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueTimestamp
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1764,7 +1765,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
IOUtils
.
getAsciiReader
(
x
),
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1808,7 +1809,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
IOUtils
.
getAsciiReader
(
x
),
length
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1852,7 +1853,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1896,7 +1897,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
length
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1917,7 +1918,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -1984,7 +1985,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2003,7 +2004,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateObject("
+
columnIndex
+
", x, "
+
scale
+
");"
);
}
update
(
columnIndex
,
DataType
.
convertToValue
(
session
,
x
,
Value
.
UNKNOWN
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2022,7 +2023,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateObject("
+
quote
(
columnName
)+
", x, "
+
scale
+
");"
);
}
update
(
columnName
,
DataType
.
convertToValue
(
session
,
x
,
Value
.
UNKNOWN
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2040,7 +2041,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateObject("
+
columnIndex
+
", x);"
);
}
update
(
columnIndex
,
DataType
.
convertToValue
(
session
,
x
,
Value
.
UNKNOWN
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2058,7 +2059,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateObject("
+
quote
(
columnName
)+
", x);"
);
}
update
(
columnName
,
DataType
.
convertToValue
(
session
,
x
,
Value
.
UNKNOWN
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2072,7 +2073,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateRef("
+
columnIndex
+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2086,7 +2087,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateRef("
+
quote
(
columnName
)+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2118,7 +2119,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2143,7 +2144,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
v
=
conn
.
createBlob
(
x
.
getBinaryStream
(),
-
1
);
}
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2168,7 +2169,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
v
=
conn
.
createBlob
(
x
.
getBinaryStream
(),
-
1
);
}
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2200,7 +2201,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createBlob
(
x
,
-
1
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2225,7 +2226,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
v
=
conn
.
createClob
(
x
.
getCharacterStream
(),
-
1
);
}
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2257,7 +2258,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2282,7 +2283,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
v
=
conn
.
createClob
(
x
.
getCharacterStream
(),
-
1
);
}
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2314,7 +2315,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2328,7 +2329,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateArray("
+
columnIndex
+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2342,7 +2343,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateArray("
+
quote
(
columnName
)+
", x);"
);
}
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2356,7 +2357,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getCursorName"
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2376,7 +2377,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
return
0
;
}
return
rowId
+
1
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2392,7 +2393,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
UpdatableRow
row
=
new
UpdatableRow
(
conn
,
result
,
session
);
return
row
.
isUpdatable
()
?
ResultSet
.
CONCUR_UPDATABLE
:
ResultSet
.
CONCUR_READ_ONLY
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2407,7 +2408,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getFetchDirection"
);
checkClosed
();
return
ResultSet
.
FETCH_FORWARD
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2422,7 +2423,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getFetchSize"
);
checkClosed
();
return
0
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2449,7 +2450,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2467,7 +2468,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"setFetchDirection"
,
direction
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2485,7 +2486,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getType"
);
checkClosed
();
return
stat
==
null
?
ResultSet
.
TYPE_FORWARD_ONLY
:
stat
.
resultSetType
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2502,7 +2503,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"isBeforeFirst"
);
checkClosed
();
return
result
.
getRowId
()
<
0
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2521,7 +2522,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
int
row
=
result
.
getRowId
();
int
count
=
result
.
getRowCount
();
return
row
>=
count
||
count
==
0
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2539,7 +2540,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
int
row
=
result
.
getRowId
();
return
row
==
0
&&
row
<
result
.
getRowCount
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2557,7 +2558,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
int
row
=
result
.
getRowId
();
return
row
>=
0
&&
row
==
result
.
getRowCount
()
-
1
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2575,7 +2576,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
if
(
result
.
getRowId
()
>=
0
)
{
resetResult
();
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2592,7 +2593,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
while
(
nextRow
())
{
// nothing
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2613,7 +2614,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
resetResult
();
return
nextRow
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2629,7 +2630,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"last"
);
checkClosed
();
return
absolute
(-
1
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2662,7 +2663,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
int
row
=
result
.
getRowId
();
return
row
>=
0
&&
row
<
result
.
getRowCount
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2688,7 +2689,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
row
=
result
.
getRowCount
()
+
1
;
}
return
absolute
(
row
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2705,7 +2706,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"previous"
);
checkClosed
();
return
relative
(-
1
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2720,7 +2721,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"moveToInsertRow"
);
checkClosed
();
insertRow
=
new
Value
[
columnCount
];
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2735,7 +2736,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"moveToCurrentRow"
);
checkClosed
();
insertRow
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2749,7 +2750,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"rowUpdated"
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2763,7 +2764,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"rowInserted"
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2777,7 +2778,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"rowDeleted"
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2796,7 +2797,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
getUpdatableRow
().
insertRow
(
insertRow
);
insertRow
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2821,7 +2822,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
row
.
refreshRow
(
result
.
currentRow
());
updateRow
=
null
;
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2842,7 +2843,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkOnValidRow
();
getUpdatableRow
().
deleteRow
(
result
.
currentRow
());
updateRow
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2864,7 +2865,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkOnValidRow
();
getUpdatableRow
().
refreshRow
(
result
.
currentRow
());
updateRow
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -2883,7 +2884,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
Message
.
getSQLException
(
ErrorCode
.
NO_DATA_AVAILABLE
);
}
updateRow
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3002,13 +3003,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
}
/**
* INTERNAL
*/
public
int
getTraceId
()
{
return
super
.
getTraceId
();
}
private
boolean
nextRow
()
throws
SQLException
{
boolean
next
=
result
.
next
();
if
(!
next
&&
!
scrollable
)
{
...
...
@@ -3081,7 +3075,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeCall
(
"getHoldability"
);
checkClosed
();
return
conn
.
getHoldability
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3095,7 +3089,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"isClosed"
);
return
result
==
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3113,7 +3107,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateNString("
+
columnIndex
+
", "
+
quote
(
x
)+
");"
);
}
update
(
columnIndex
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3131,7 +3125,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode
(
"updateNString("
+
quote
(
columnName
)+
", "
+
quote
(
x
)+
");"
);
}
update
(
columnName
,
x
==
null
?
(
Value
)
ValueNull
.
INSTANCE
:
ValueString
.
get
(
x
));
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3146,7 +3140,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+columnIndex+", x);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3162,7 +3156,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+columnIndex+", x);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3179,7 +3173,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+columnIndex+", x, " + length + "L);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3196,7 +3190,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+quote(columnName)+", x);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3213,7 +3207,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+quote(columnName)+", x, " + length+"L);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3229,7 +3223,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCode("updateNClob("+quote(columnName)+", x);");
}
throw Message.getUnsupportedException();
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3250,7 +3244,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnIndex + ")");
Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcClob(session, conn, v, id);
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3270,7 +3264,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnName + ")");
Value v = get(columnName);
return v == ValueNull.INSTANCE ? null : new JdbcClob(session, conn, v, id);
} catch (
Throwable
e) {
} catch (
Exception
e) {
throw logAndConvert(e);
}
}
...
...
@@ -3326,7 +3320,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getNString"
,
columnIndex
);
return
get
(
columnIndex
).
getString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3343,7 +3337,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getNString"
,
columnName
);
return
get
(
columnName
).
getString
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3360,7 +3354,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getNCharacterStream"
,
columnIndex
);
return
get
(
columnIndex
).
getReader
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3377,7 +3371,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
try
{
debugCodeCall
(
"getNCharacterStream"
,
columnName
);
return
get
(
columnName
).
getReader
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3409,7 +3403,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnIndex
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -3441,7 +3435,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
checkClosed
();
Value
v
=
conn
.
createClob
(
x
,
length
);
update
(
columnName
,
v
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcResultSetMetaData.java
浏览文件 @
3ac7cad3
...
...
@@ -27,7 +27,8 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
private
final
ResultInterface
result
;
private
final
int
columnCount
;
JdbcResultSetMetaData
(
JdbcResultSet
rs
,
JdbcPreparedStatement
prep
,
ResultInterface
result
,
String
catalog
,
Trace
trace
,
int
id
)
{
JdbcResultSetMetaData
(
JdbcResultSet
rs
,
JdbcPreparedStatement
prep
,
ResultInterface
result
,
String
catalog
,
Trace
trace
,
int
id
)
{
setTrace
(
trace
,
TraceObject
.
RESULT_SET_META_DATA
,
id
);
this
.
catalog
=
catalog
;
this
.
rs
=
rs
;
...
...
@@ -47,7 +48,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getColumnCount"
);
checkClosed
();
return
columnCount
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -64,7 +65,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getColumnLabel"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getAlias
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -81,7 +82,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getColumnName"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getColumnName
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -99,7 +100,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
checkColumnIndex
(
column
);
int
type
=
result
.
getColumnType
(--
column
);
return
DataType
.
convertTypeToSQLType
(
type
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -117,7 +118,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
checkColumnIndex
(
column
);
int
type
=
result
.
getColumnType
(--
column
);
return
DataType
.
getDataType
(
type
).
name
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -134,7 +135,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getSchemaName"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getSchemaName
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -151,7 +152,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getTableName"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getTableName
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -168,7 +169,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getCatalogName"
,
column
);
checkColumnIndex
(
column
);
return
catalog
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -186,7 +187,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isAutoIncrement"
,
column
);
checkColumnIndex
(
column
);
return
result
.
isAutoIncrement
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -204,7 +205,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isCaseSensitive"
,
column
);
checkColumnIndex
(
column
);
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -222,7 +223,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isSearchable"
,
column
);
checkColumnIndex
(
column
);
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -240,7 +241,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isCurrency"
,
column
);
checkColumnIndex
(
column
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -261,7 +262,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isNullable"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getNullable
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -279,7 +280,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isSigned"
,
column
);
checkColumnIndex
(
column
);
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -297,7 +298,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isReadOnly"
,
column
);
checkColumnIndex
(
column
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -315,7 +316,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isWritable"
,
column
);
checkColumnIndex
(
column
);
return
true
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -333,7 +334,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"isDefinitelyWritable"
,
column
);
checkColumnIndex
(
column
);
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -352,7 +353,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
checkColumnIndex
(
column
);
int
type
=
result
.
getColumnType
(--
column
);
return
DataType
.
getTypeClassName
(
type
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -371,7 +372,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
checkColumnIndex
(
column
);
long
prec
=
result
.
getColumnPrecision
(--
column
);
return
MathUtils
.
convertLongToInt
(
prec
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -389,7 +390,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getScale"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getColumnScale
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -406,7 +407,7 @@ public class JdbcResultSetMetaData extends TraceObject implements ResultSetMetaD
debugCodeCall
(
"getColumnDisplaySize"
,
column
);
checkColumnIndex
(
column
);
return
result
.
getDisplaySize
(--
column
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcSavepoint.java
浏览文件 @
3ac7cad3
...
...
@@ -75,7 +75,7 @@ implements Savepoint
throw
Message
.
getSQLException
(
ErrorCode
.
SAVEPOINT_IS_NAMED
);
}
return
savepointId
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -92,7 +92,7 @@ implements Savepoint
throw
Message
.
getSQLException
(
ErrorCode
.
SAVEPOINT_IS_UNNAMED
);
}
return
name
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbc/JdbcStatement.java
浏览文件 @
3ac7cad3
...
...
@@ -40,10 +40,10 @@ public class JdbcStatement extends TraceObject implements Statement {
private
ObjectArray
batchCommands
;
private
boolean
escapeProcessing
=
true
;
JdbcStatement
(
SessionInterface
session
,
JdbcConnection
conn
,
int
resultSetType
,
int
id
,
boolean
closeWithResultSet
)
{
setTrace
(
session
.
getTrace
(),
TraceObject
.
STATEMENT
,
id
);
this
.
session
=
session
;
JdbcStatement
(
JdbcConnection
conn
,
int
resultSetType
,
int
id
,
boolean
closeWithResultSet
)
{
this
.
conn
=
conn
;
this
.
session
=
conn
.
getSession
();
setTrace
(
session
.
getTrace
(),
TraceObject
.
STATEMENT
,
id
);
this
.
resultSetType
=
resultSetType
;
this
.
closedByResultSet
=
closeWithResultSet
;
}
...
...
@@ -77,10 +77,10 @@ public class JdbcStatement extends TraceObject implements Statement {
setExecutingStatement
(
null
);
}
command
.
close
();
resultSet
=
new
JdbcResultSet
(
session
,
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
}
return
resultSet
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -121,7 +121,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
command
.
close
();
return
updateCount
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -157,7 +157,7 @@ public class JdbcStatement extends TraceObject implements Statement {
returnsResultSet
=
true
;
boolean
scrollable
=
resultSetType
!=
ResultSet
.
TYPE_FORWARD_ONLY
;
ResultInterface
result
=
command
.
executeQuery
(
maxRows
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
session
,
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
resultSet
=
new
JdbcResultSet
(
conn
,
this
,
result
,
id
,
closedByResultSet
,
scrollable
);
}
else
{
returnsResultSet
=
false
;
updateCount
=
command
.
executeUpdate
();
...
...
@@ -168,7 +168,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
command
.
close
();
return
returnsResultSet
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -188,7 +188,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getResultSet"
);
}
return
resultSet
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -206,7 +206,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getUpdateCount"
);
checkClosed
();
return
updateCount
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -223,7 +223,7 @@ public class JdbcStatement extends TraceObject implements Statement {
if
(
conn
!=
null
)
{
conn
=
null
;
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -238,7 +238,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getConnection"
);
checkClosed
();
return
conn
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -254,7 +254,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getWarnings"
);
checkClosed
();
return
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -267,7 +267,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"clearWarnings"
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -287,7 +287,7 @@ public class JdbcStatement extends TraceObject implements Statement {
checkClosed
();
closeOld
();
return
false
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -302,7 +302,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"setCursorName"
,
name
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -318,7 +318,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"setFetchDirection"
,
direction
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -334,7 +334,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getFetchDirection"
);
checkClosed
();
return
ResultSet
.
FETCH_FORWARD
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -350,7 +350,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getMaxRows"
);
checkClosed
();
return
maxRows
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -369,7 +369,7 @@ public class JdbcStatement extends TraceObject implements Statement {
throw
Message
.
getInvalidValueException
(
""
+
maxRows
,
"maxRows"
);
}
this
.
maxRows
=
maxRows
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -396,7 +396,7 @@ public class JdbcStatement extends TraceObject implements Statement {
rows
=
SysProperties
.
SERVER_RESULT_SET_FETCH_SIZE
;
}
fetchSize
=
rows
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -412,7 +412,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getFetchSize"
);
checkClosed
();
return
fetchSize
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -428,7 +428,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getResultSetConcurrency"
);
checkClosed
();
return
ResultSet
.
CONCUR_UPDATABLE
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -444,7 +444,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getResultSetType"
);
checkClosed
();
return
resultSetType
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -460,7 +460,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getMaxFieldSize"
);
checkClosed
();
return
0
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -476,7 +476,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"setMaxFieldSize"
,
max
);
checkClosed
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -495,7 +495,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
checkClosed
();
escapeProcessing
=
enable
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -520,7 +520,7 @@ public class JdbcStatement extends TraceObject implements Statement {
}
finally
{
setExecutingStatement
(
null
);
}
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -538,7 +538,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getQueryTimeout"
);
checkClosed
();
return
conn
.
getQueryTimeout
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -562,7 +562,7 @@ public class JdbcStatement extends TraceObject implements Statement {
throw
Message
.
getInvalidValueException
(
""
+
seconds
,
"seconds"
);
}
conn
.
setQueryTimeout
(
seconds
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -581,7 +581,7 @@ public class JdbcStatement extends TraceObject implements Statement {
batchCommands
=
new
ObjectArray
();
}
batchCommands
.
add
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -594,7 +594,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"clearBatch"
);
checkClosed
();
batchCommands
=
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -631,7 +631,7 @@ public class JdbcStatement extends TraceObject implements Statement {
throw
new
BatchUpdateException
(
result
);
}
return
result
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -651,9 +651,9 @@ public class JdbcStatement extends TraceObject implements Statement {
}
checkClosed
();
ResultInterface
result
=
conn
.
getGeneratedKeys
();
ResultSet
rs
=
new
JdbcResultSet
(
session
,
conn
,
this
,
result
,
id
,
false
,
true
);
ResultSet
rs
=
new
JdbcResultSet
(
conn
,
this
,
result
,
id
,
false
,
true
);
return
rs
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -665,7 +665,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"getMoreResults"
);
throw
Message
.
getUnsupportedException
();
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -687,7 +687,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"executeUpdate("
+
quote
(
sql
)+
", "
+
autoGeneratedKeys
+
");"
);
}
return
executeUpdate
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -709,7 +709,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"executeUpdate("
+
quote
(
sql
)+
", "
+
quoteIntArray
(
columnIndexes
)+
");"
);
}
return
executeUpdate
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -731,7 +731,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"executeUpdate("
+
quote
(
sql
)+
", "
+
quoteArray
(
columnNames
)+
");"
);
}
return
executeUpdate
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -753,7 +753,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"execute("
+
quote
(
sql
)+
", "
+
autoGeneratedKeys
+
");"
);
}
return
execute
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -775,7 +775,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"execute("
+
quote
(
sql
)+
", "
+
quoteIntArray
(
columnIndexes
)+
");"
);
}
return
execute
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -797,7 +797,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCode
(
"execute("
+
quote
(
sql
)+
", "
+
quoteArray
(
columnNames
)+
");"
);
}
return
execute
(
sql
);
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -813,7 +813,7 @@ public class JdbcStatement extends TraceObject implements Statement {
debugCodeCall
(
"getResultSetHoldability"
);
checkClosed
();
return
ResultSet
.
HOLD_CURSORS_OVER_COMMIT
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
@@ -855,7 +855,7 @@ public class JdbcStatement extends TraceObject implements Statement {
try
{
debugCodeCall
(
"isClosed"
);
return
conn
==
null
;
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
logAndConvert
(
e
);
}
}
...
...
h2/src/main/org/h2/jdbcx/JdbcConnectionPool.java
浏览文件 @
3ac7cad3
...
...
@@ -26,9 +26,9 @@ import java.sql.SQLException;
import
java.util.Stack
;
import
javax.sql.ConnectionEvent
;
import
javax.sql.DataSource
;
import
javax.sql.ConnectionEventListener
;
import
javax.sql.ConnectionPoolDataSource
;
import
javax.sql.DataSource
;
import
javax.sql.PooledConnection
;
/*## Java 1.6 begin ##
...
...
h2/src/main/org/h2/jdbcx/JdbcDataSourceFactory.java
浏览文件 @
3ac7cad3
...
...
@@ -59,7 +59,7 @@ implements ObjectFactory
* not JdbcDataSource.
*/
//## Java 1.4 begin ##
public
synchronized
Object
getObjectInstance
(
Object
obj
,
Name
name
,
Context
nameCtx
,
Hashtable
environment
)
throws
Exception
{
public
synchronized
Object
getObjectInstance
(
Object
obj
,
Name
name
,
Context
nameCtx
,
Hashtable
environment
)
{
if
(
trace
.
isDebugEnabled
())
{
trace
.
debug
(
"getObjectInstance obj="
+
obj
+
" name="
+
name
+
" nameCtx="
+
nameCtx
+
" environment="
+
environment
);
}
...
...
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
3ac7cad3
...
...
@@ -19,10 +19,10 @@ import javax.sql.XAConnection;
import
javax.transaction.xa.XAException
;
import
javax.transaction.xa.XAResource
;
import
javax.transaction.xa.Xid
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.util.ByteUtils
;
import
org.h2.util.JdbcConnectionListener
;
import
org.h2.util.JdbcUtils
;
import
org.h2.jdbc.JdbcConnection
;
//## Java 1.4 end ##
import
org.h2.message.TraceObject
;
...
...
@@ -83,6 +83,8 @@ implements XAConnection, XAResource, JdbcConnectionListener
/**
* Close the physical connection.
* This method is usually called by the connection pool.
*
* @throws SQLException
*/
//## Java 1.4 begin ##
public
void
close
()
throws
SQLException
{
...
...
@@ -102,6 +104,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
* pool when there are no more connections in the pool.
*
* @return the connection
* @throws SQLException
*/
//## Java 1.4 begin ##
public
Connection
getConnection
()
throws
SQLException
{
...
...
@@ -217,6 +220,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
* @param flag TMSTARTRSCAN, TMENDRSCAN, or TMNOFLAGS. If no other flags are set,
* TMNOFLAGS must be used.
* @return zero or more Xid objects
* @throws XAException
*/
//## Java 1.4 begin ##
public
Xid
[]
recover
(
int
flag
)
throws
XAException
{
...
...
@@ -249,6 +253,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
* Prepare a transaction.
*
* @param xid the transaction id
* @throws XAException
*/
//## Java 1.4 begin ##
public
int
prepare
(
Xid
xid
)
throws
XAException
{
...
...
@@ -291,6 +296,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
* Roll back a transaction.
*
* @param xid the transaction id
* @throws XAException
*/
//## Java 1.4 begin ##
public
void
rollback
(
Xid
xid
)
throws
XAException
{
...
...
@@ -311,6 +317,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
*
* @param xid the transaction id
* @param flags TMSUCCESS, TMFAIL, or TMSUSPEND
* @throws XAException
*/
//## Java 1.4 begin ##
public
void
end
(
Xid
xid
,
int
flags
)
throws
XAException
{
...
...
@@ -332,6 +339,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
*
* @param xid the transaction id
* @param flags TMNOFLAGS, TMJOIN, or TMRESUME
* @throws XAException
*/
//## Java 1.4 begin ##
public
void
start
(
Xid
xid
,
int
flags
)
throws
XAException
{
...
...
@@ -358,6 +366,7 @@ implements XAConnection, XAResource, JdbcConnectionListener
*
* @param xid the transaction id
* @param onePhase use a one-phase protocol if true
* @throws XAException
*/
//## Java 1.4 begin ##
public
void
commit
(
Xid
xid
,
boolean
onePhase
)
throws
XAException
{
...
...
h2/src/main/org/h2/jdbcx/JdbcXid.java
浏览文件 @
3ac7cad3
...
...
@@ -44,7 +44,7 @@ implements Xid
formatId
=
Integer
.
parseInt
(
tokenizer
.
nextToken
());
branchQualifier
=
ByteUtils
.
convertStringToBytes
(
tokenizer
.
nextToken
());
globalTransactionId
=
ByteUtils
.
convertStringToBytes
(
tokenizer
.
nextToken
());
}
catch
(
Throwable
e
)
{
}
catch
(
Exception
e
)
{
throw
Message
.
getSQLException
(
ErrorCode
.
WRONG_XID_FORMAT_1
,
tid
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论