Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
74b86ad8
提交
74b86ad8
authored
8月 18, 2012
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Issue 416: PreparedStatement.setNString throws AbstractMethodError.
上级
07b054c6
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
31 行增加
和
95 行删除
+31
-95
changelog.html
h2/src/docsrc/html/changelog.html
+4
-1
JdbcCallableStatement.java
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
+0
-44
JdbcClob.java
h2/src/main/org/h2/jdbc/JdbcClob.java
+0
-2
JdbcPreparedStatement.java
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
+0
-9
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+27
-39
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
74b86ad8
...
...
@@ -18,7 +18,10 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Issue 414: for some functions, the parameters were evaluated twice
<ul><li>
Issue 416: PreparedStatement.setNString throws AbstractMethodError.
All implemented JDBC 4 methods that don't break compatiblity with Java 5
are now included in the default jar file.
</li><li>
Issue 414: for some functions, the parameters were evaluated twice
(for example "char(nextval(..))" ran "nextval(..)" twice).
</li><li>
The ResultSetMetaData methods getSchemaName and getTableName
could return null instead of "" (an empty string) as specified in the JDBC API.
...
...
h2/src/main/org/h2/jdbc/JdbcCallableStatement.java
浏览文件 @
74b86ad8
...
...
@@ -794,12 +794,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
String
getNString
(
int
parameterIndex
)
throws
SQLException
{
checkRegistered
(
parameterIndex
);
return
getOpenResultSet
().
getNString
(
parameterIndex
);
}
//*/
/**
* Returns the value of the specified column as a String.
...
...
@@ -809,11 +807,9 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
String
getNString
(
String
parameterName
)
throws
SQLException
{
return
getNString
(
getIndexForName
(
parameterName
));
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -823,13 +819,11 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
int
parameterIndex
)
throws
SQLException
{
checkRegistered
(
parameterIndex
);
return
getOpenResultSet
().
getNCharacterStream
(
parameterIndex
);
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -839,12 +833,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
String
parameterName
)
throws
SQLException
{
return
getNCharacterStream
(
getIndexForName
(
parameterName
));
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -854,13 +846,11 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getCharacterStream
(
int
parameterIndex
)
throws
SQLException
{
checkRegistered
(
parameterIndex
);
return
getOpenResultSet
().
getCharacterStream
(
parameterIndex
);
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -870,12 +860,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getCharacterStream
(
String
parameterName
)
throws
SQLException
{
return
getCharacterStream
(
getIndexForName
(
parameterName
));
}
//*/
// =============================================================
...
...
@@ -1192,12 +1180,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNString
(
String
parameterName
,
String
x
)
throws
SQLException
{
setNString
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1209,12 +1195,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNCharacterStream
(
String
parameterName
,
Reader
x
,
long
length
)
throws
SQLException
{
setNCharacterStream
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1240,12 +1224,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setClob
(
String
parameterName
,
Reader
x
,
long
length
)
throws
SQLException
{
setClob
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a Blob.
...
...
@@ -1257,12 +1239,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of bytes
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setBlob
(
String
parameterName
,
InputStream
x
,
long
length
)
throws
SQLException
{
setBlob
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1274,12 +1254,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNClob
(
String
parameterName
,
Reader
x
,
long
length
)
throws
SQLException
{
setNClob
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a Blob.
...
...
@@ -1288,12 +1266,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setBlob
(
String
parameterName
,
Blob
x
)
throws
SQLException
{
setBlob
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1302,11 +1278,9 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setClob
(
String
parameterName
,
Clob
x
)
throws
SQLException
{
setClob
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as an ASCII stream.
...
...
@@ -1317,12 +1291,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setAsciiStream
(
String
parameterName
,
InputStream
x
)
throws
SQLException
{
setAsciiStream
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as an ASCII stream.
...
...
@@ -1348,12 +1320,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setBinaryStream
(
String
parameterName
,
InputStream
x
)
throws
SQLException
{
setBinaryStream
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as an input stream.
...
...
@@ -1365,12 +1335,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of bytes
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setBinaryStream
(
String
parameterName
,
InputStream
x
,
long
length
)
throws
SQLException
{
setBinaryStream
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a Blob.
...
...
@@ -1381,12 +1349,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setBlob
(
String
parameterName
,
InputStream
x
)
throws
SQLException
{
setBlob
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1397,12 +1363,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setCharacterStream
(
String
parameterName
,
Reader
x
)
throws
SQLException
{
setCharacterStream
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1414,12 +1378,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setCharacterStream
(
String
parameterName
,
Reader
x
,
long
length
)
throws
SQLException
{
setCharacterStream
(
getIndexForName
(
parameterName
),
x
,
length
);
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1430,11 +1392,9 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setClob
(
String
parameterName
,
Reader
x
)
throws
SQLException
{
setClob
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1445,12 +1405,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNCharacterStream
(
String
parameterName
,
Reader
x
)
throws
SQLException
{
setNCharacterStream
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1461,12 +1419,10 @@ public class JdbcCallableStatement extends JdbcPreparedStatement implements Call
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNClob
(
String
parameterName
,
Reader
x
)
throws
SQLException
{
setNClob
(
getIndexForName
(
parameterName
),
x
);
}
//*/
/**
* [Not supported] Sets the value of a parameter as a SQLXML object.
...
...
h2/src/main/org/h2/jdbc/JdbcClob.java
浏览文件 @
74b86ad8
...
...
@@ -256,11 +256,9 @@ public class JdbcClob extends TraceObject implements Clob
/**
* [Not supported] Returns the reader, starting from an offset.
*/
//## Java 1.6 ##
public
Reader
getCharacterStream
(
long
pos
,
long
length
)
throws
SQLException
{
throw
unsupported
(
"LOB subset"
);
}
//*/
private
void
checkClosed
()
{
conn
.
checkClosed
();
...
...
h2/src/main/org/h2/jdbc/JdbcPreparedStatement.java
浏览文件 @
74b86ad8
...
...
@@ -1304,7 +1304,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNString
(
int
parameterIndex
,
String
x
)
throws
SQLException
{
try
{
if
(
isDebugEnabled
())
{
...
...
@@ -1316,7 +1315,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1328,7 +1326,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNCharacterStream
(
int
parameterIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
try
{
...
...
@@ -1347,7 +1344,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Sets the value of a parameter as a character stream.
...
...
@@ -1358,12 +1354,10 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNCharacterStream
(
int
parameterIndex
,
Reader
x
)
throws
SQLException
{
setNCharacterStream
(
parameterIndex
,
x
,
-
1
);
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1401,7 +1395,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param x the value
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNClob
(
int
parameterIndex
,
Reader
x
)
throws
SQLException
{
try
{
if
(
isDebugEnabled
())
{
...
...
@@ -1418,7 +1411,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Sets the value of a parameter as a Clob.
...
...
@@ -1484,7 +1476,6 @@ public class JdbcPreparedStatement extends JdbcStatement implements PreparedStat
* @param length the maximum number of characters
* @throws SQLException if this object is closed
*/
//## Java 1.6 ##
public
void
setNClob
(
int
parameterIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
try
{
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
74b86ad8
...
...
@@ -3096,7 +3096,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNString
(
int
columnIndex
,
String
x
)
throws
SQLException
{
try
{
if
(
isDebugEnabled
())
{
...
...
@@ -3108,7 +3107,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Updates a column in the current or insert row.
...
...
@@ -3117,7 +3115,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNString
(
String
columnLabel
,
String
x
)
throws
SQLException
{
try
{
if
(
isDebugEnabled
())
{
...
...
@@ -3129,7 +3126,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* [Not supported]
...
...
@@ -3141,43 +3137,52 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
//*/
/**
* [Not supported]
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
throw
unsupported
(
"NClob"
);
updateClob
(
columnIndex
,
x
,
-
1
);
}
//*/
/**
* [Not supported]
* Updates a column in the current or insert row.
*
* @param columnIndex (1,2,...)
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNClob
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
unsupported
(
"NClob"
);
updateClob
(
columnIndex
,
x
,
length
);
}
//*/
/**
* [Not supported]
* Updates a column in the current or insert row.
*
* @param columnLabel the column label
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
throw
unsupported
(
"NClob"
);
public
void
updateNClob
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
updateClob
(
columnLabel
,
x
,
-
1
);
}
//*/
/**
* [Not supported]
* Updates a column in the current or insert row.
*
* @param columnLabel the column label
* @param x the value
* @param length the length
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNClob
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
throw
unsupported
(
"NClob"
);
updateClob
(
columnLabel
,
x
,
length
);
}
//*/
/**
* [Not supported]
...
...
@@ -3188,7 +3193,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
}
//*/
/**
* Returns the value of the specified column as a Clob.
*
...
...
@@ -3275,7 +3279,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
String
getNString
(
int
columnIndex
)
throws
SQLException
{
try
{
debugCodeCall
(
"getNString"
,
columnIndex
);
...
...
@@ -3284,7 +3287,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Returns the value of the specified column as a String.
...
...
@@ -3294,7 +3296,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
String
getNString
(
String
columnLabel
)
throws
SQLException
{
try
{
debugCodeCall
(
"getNString"
,
columnLabel
);
...
...
@@ -3303,7 +3304,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -3313,7 +3313,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
int
columnIndex
)
throws
SQLException
{
try
{
debugCodeCall
(
"getNCharacterStream"
,
columnIndex
);
...
...
@@ -3322,7 +3321,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Returns the value of the specified column as a reader.
...
...
@@ -3332,7 +3330,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @throws SQLException if the column is not found or if the result set is
* closed
*/
//## Java 1.6 ##
public
Reader
getNCharacterStream
(
String
columnLabel
)
throws
SQLException
{
try
{
debugCodeCall
(
"getNCharacterStream"
,
columnLabel
);
...
...
@@ -3341,7 +3338,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Updates a column in the current or insert row.
...
...
@@ -3350,12 +3346,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
)
throws
SQLException
{
updateNCharacterStream
(
columnIndex
,
x
,
-
1
);
}
//*/
/**
* Updates a column in the current or insert row.
...
...
@@ -3365,7 +3359,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param length the number of characters
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
int
columnIndex
,
Reader
x
,
long
length
)
throws
SQLException
{
try
{
...
...
@@ -3379,7 +3372,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* Updates a column in the current or insert row.
...
...
@@ -3388,12 +3380,10 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param x the value
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
)
throws
SQLException
{
updateNCharacterStream
(
columnLabel
,
x
,
-
1
);
}
//*/
/**
* Updates a column in the current or insert row.
...
...
@@ -3403,7 +3393,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
* @param length the number of characters
* @throws SQLException if the result set is closed or not updatable
*/
//## Java 1.6 ##
public
void
updateNCharacterStream
(
String
columnLabel
,
Reader
x
,
long
length
)
throws
SQLException
{
try
{
...
...
@@ -3417,7 +3406,6 @@ public class JdbcResultSet extends TraceObject implements ResultSet {
throw
logAndConvert
(
e
);
}
}
//*/
/**
* [Not supported] Return an object of this class if possible.
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论