提交 74b86ad8 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 416: PreparedStatement.setNString throws AbstractMethodError.

上级 07b054c6
......@@ -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.
......
......@@ -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();
......
......@@ -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 {
......
......@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论