| | 1 | Taken from https://issues.apache.org/jira/browse/DBCP-191 |
| | 2 | |
| | 3 | Index: src/test/org/apache/commons/dbcp/TesterPreparedStatement.java |
| | 4 | =================================================================== |
| | 5 | --- src/test/org/apache/commons/dbcp/TesterPreparedStatement.java (revision 558600) |
| | 6 | +++ src/test/org/apache/commons/dbcp/TesterPreparedStatement.java (working copy) |
| | 7 | @@ -28,6 +28,13 @@ |
| | 8 | import java.sql.ResultSetMetaData; |
| | 9 | import java.sql.SQLException; |
| | 10 | import java.util.Calendar; |
| | 11 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 12 | +import java.io.InputStream; |
| | 13 | +import java.io.Reader; |
| | 14 | +import java.sql.NClob; |
| | 15 | +import java.sql.RowId; |
| | 16 | +import java.sql.SQLXML; |
| | 17 | +/* JDBC_4_ANT_KEY_END */ |
| | 18 | |
| | 19 | /** |
| | 20 | * A dummy {@link PreparedStatement}, for testing purposes. |
| | 21 | @@ -288,7 +295,79 @@ |
| | 22 | public java.sql.ParameterMetaData getParameterMetaData() throws SQLException { |
| | 23 | throw new SQLException("Not implemented."); |
| | 24 | } |
| | 25 | - |
| | 26 | /* JDBC_3_ANT_KEY_END */ |
| | 27 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 28 | |
| | 29 | + public void setRowId(int parameterIndex, RowId value) throws SQLException { |
| | 30 | + throw new SQLException("Not implemented."); |
| | 31 | + } |
| | 32 | + |
| | 33 | + public void setNString(int parameterIndex, String value) throws SQLException { |
| | 34 | + throw new SQLException("Not implemented."); |
| | 35 | + } |
| | 36 | + |
| | 37 | + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { |
| | 38 | + throw new SQLException("Not implemented."); |
| | 39 | + } |
| | 40 | + |
| | 41 | + public void setNClob(int parameterIndex, NClob value) throws SQLException { |
| | 42 | + throw new SQLException("Not implemented."); |
| | 43 | + } |
| | 44 | + |
| | 45 | + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 46 | + throw new SQLException("Not implemented."); |
| | 47 | + } |
| | 48 | + |
| | 49 | + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 50 | + throw new SQLException("Not implemented."); |
| | 51 | + } |
| | 52 | + |
| | 53 | + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 54 | + throw new SQLException("Not implemented."); |
| | 55 | + } |
| | 56 | + |
| | 57 | + public void setSQLXML(int parameterIndex, SQLXML value) throws SQLException { |
| | 58 | + throw new SQLException("Not implemented."); |
| | 59 | + } |
| | 60 | + |
| | 61 | + public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 62 | + throw new SQLException("Not implemented."); |
| | 63 | + } |
| | 64 | + |
| | 65 | + public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 66 | + throw new SQLException("Not implemented."); |
| | 67 | + } |
| | 68 | + |
| | 69 | + public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 70 | + throw new SQLException("Not implemented."); |
| | 71 | + } |
| | 72 | + |
| | 73 | + public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 74 | + throw new SQLException("Not implemented."); |
| | 75 | + } |
| | 76 | + |
| | 77 | + public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 78 | + throw new SQLException("Not implemented."); |
| | 79 | + } |
| | 80 | + |
| | 81 | + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { |
| | 82 | + throw new SQLException("Not implemented."); |
| | 83 | + } |
| | 84 | + |
| | 85 | + public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException { |
| | 86 | + throw new SQLException("Not implemented."); |
| | 87 | + } |
| | 88 | + |
| | 89 | + public void setClob(int parameterIndex, Reader reader) throws SQLException { |
| | 90 | + throw new SQLException("Not implemented."); |
| | 91 | + } |
| | 92 | + |
| | 93 | + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 94 | + throw new SQLException("Not implemented."); |
| | 95 | + } |
| | 96 | + |
| | 97 | + public void setNClob(int parameterIndex, Reader reader) throws SQLException { |
| | 98 | + throw new SQLException("Not implemented."); |
| | 99 | + } |
| | 100 | +/* JDBC_4_ANT_KEY_END */ |
| | 101 | } |
| | 102 | Index: src/test/org/apache/commons/dbcp/TesterResultSet.java |
| | 103 | =================================================================== |
| | 104 | --- src/test/org/apache/commons/dbcp/TesterResultSet.java (revision 558600) |
| | 105 | +++ src/test/org/apache/commons/dbcp/TesterResultSet.java (working copy) |
| | 106 | @@ -28,6 +28,13 @@ |
| | 107 | import java.sql.SQLWarning; |
| | 108 | import java.sql.Statement; |
| | 109 | import java.util.Calendar; |
| | 110 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 111 | +import java.io.InputStream; |
| | 112 | +import java.io.Reader; |
| | 113 | +import java.sql.NClob; |
| | 114 | +import java.sql.RowId; |
| | 115 | +import java.sql.SQLXML; |
| | 116 | +/* JDBC_4_ANT_KEY_END */ |
| | 117 | |
| | 118 | /** |
| | 119 | * A dummy {@link ResultSet}, for testing purposes. |
| | 120 | @@ -759,7 +766,207 @@ |
| | 121 | throws SQLException { |
| | 122 | throw new SQLException("Not implemented."); |
| | 123 | } |
| | 124 | - |
| | 125 | /* JDBC_3_ANT_KEY_END */ |
| | 126 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 127 | |
| | 128 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 129 | + throw new SQLException("Not implemented."); |
| | 130 | + } |
| | 131 | + |
| | 132 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 133 | + throw new SQLException("Not implemented."); |
| | 134 | + } |
| | 135 | + |
| | 136 | + public RowId getRowId(int columnIndex) throws SQLException { |
| | 137 | + throw new SQLException("Not implemented."); |
| | 138 | + } |
| | 139 | + |
| | 140 | + public RowId getRowId(String columnLabel) throws SQLException { |
| | 141 | + throw new SQLException("Not implemented."); |
| | 142 | + } |
| | 143 | + |
| | 144 | + public void updateRowId(int columnIndex, RowId value) throws SQLException { |
| | 145 | + throw new SQLException("Not implemented."); |
| | 146 | + } |
| | 147 | + |
| | 148 | + public void updateRowId(String columnLabel, RowId value) throws SQLException { |
| | 149 | + throw new SQLException("Not implemented."); |
| | 150 | + } |
| | 151 | + |
| | 152 | + public int getHoldability() throws SQLException { |
| | 153 | + throw new SQLException("Not implemented."); |
| | 154 | + } |
| | 155 | + |
| | 156 | + public boolean isClosed() throws SQLException { |
| | 157 | + throw new SQLException("Not implemented."); |
| | 158 | + } |
| | 159 | + |
| | 160 | + public void updateNString(int columnIndex, String value) throws SQLException { |
| | 161 | + throw new SQLException("Not implemented."); |
| | 162 | + } |
| | 163 | + |
| | 164 | + public void updateNString(String columnLabel, String value) throws SQLException { |
| | 165 | + throw new SQLException("Not implemented."); |
| | 166 | + } |
| | 167 | + |
| | 168 | + public void updateNClob(int columnIndex, NClob value) throws SQLException { |
| | 169 | + throw new SQLException("Not implemented."); |
| | 170 | + } |
| | 171 | + |
| | 172 | + public void updateNClob(String columnLabel, NClob value) throws SQLException { |
| | 173 | + throw new SQLException("Not implemented."); |
| | 174 | + } |
| | 175 | + |
| | 176 | + public NClob getNClob(int columnIndex) throws SQLException { |
| | 177 | + throw new SQLException("Not implemented."); |
| | 178 | + } |
| | 179 | + |
| | 180 | + public NClob getNClob(String columnLabel) throws SQLException { |
| | 181 | + throw new SQLException("Not implemented."); |
| | 182 | + } |
| | 183 | + |
| | 184 | + public SQLXML getSQLXML(int columnIndex) throws SQLException { |
| | 185 | + throw new SQLException("Not implemented."); |
| | 186 | + } |
| | 187 | + |
| | 188 | + public SQLXML getSQLXML(String columnLabel) throws SQLException { |
| | 189 | + throw new SQLException("Not implemented."); |
| | 190 | + } |
| | 191 | + |
| | 192 | + public void updateSQLXML(int columnIndex, SQLXML value) throws SQLException { |
| | 193 | + throw new SQLException("Not implemented."); |
| | 194 | + } |
| | 195 | + |
| | 196 | + public void updateSQLXML(String columnLabel, SQLXML value) throws SQLException { |
| | 197 | + throw new SQLException("Not implemented."); |
| | 198 | + } |
| | 199 | + |
| | 200 | + public String getNString(int columnIndex) throws SQLException { |
| | 201 | + throw new SQLException("Not implemented."); |
| | 202 | + } |
| | 203 | + |
| | 204 | + public String getNString(String columnLabel) throws SQLException { |
| | 205 | + throw new SQLException("Not implemented."); |
| | 206 | + } |
| | 207 | + |
| | 208 | + public Reader getNCharacterStream(int columnIndex) throws SQLException { |
| | 209 | + throw new SQLException("Not implemented."); |
| | 210 | + } |
| | 211 | + |
| | 212 | + public Reader getNCharacterStream(String columnLabel) throws SQLException { |
| | 213 | + throw new SQLException("Not implemented."); |
| | 214 | + } |
| | 215 | + |
| | 216 | + public void updateNCharacterStream(int columnIndex, Reader reader, long length) throws SQLException { |
| | 217 | + throw new SQLException("Not implemented."); |
| | 218 | + } |
| | 219 | + |
| | 220 | + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { |
| | 221 | + throw new SQLException("Not implemented."); |
| | 222 | + } |
| | 223 | + |
| | 224 | + public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 225 | + throw new SQLException("Not implemented."); |
| | 226 | + } |
| | 227 | + |
| | 228 | + public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 229 | + throw new SQLException("Not implemented."); |
| | 230 | + } |
| | 231 | + |
| | 232 | + public void updateCharacterStream(int columnIndex, Reader reader, long length) throws SQLException { |
| | 233 | + throw new SQLException("Not implemented."); |
| | 234 | + } |
| | 235 | + |
| | 236 | + public void updateAsciiStream(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 237 | + throw new SQLException("Not implemented."); |
| | 238 | + } |
| | 239 | + |
| | 240 | + public void updateBinaryStream(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 241 | + throw new SQLException("Not implemented."); |
| | 242 | + } |
| | 243 | + |
| | 244 | + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { |
| | 245 | + throw new SQLException("Not implemented."); |
| | 246 | + } |
| | 247 | + |
| | 248 | + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 249 | + throw new SQLException("Not implemented."); |
| | 250 | + } |
| | 251 | + |
| | 252 | + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 253 | + throw new SQLException("Not implemented."); |
| | 254 | + } |
| | 255 | + |
| | 256 | + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { |
| | 257 | + throw new SQLException("Not implemented."); |
| | 258 | + } |
| | 259 | + |
| | 260 | + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { |
| | 261 | + throw new SQLException("Not implemented."); |
| | 262 | + } |
| | 263 | + |
| | 264 | + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { |
| | 265 | + throw new SQLException("Not implemented."); |
| | 266 | + } |
| | 267 | + |
| | 268 | + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { |
| | 269 | + throw new SQLException("Not implemented."); |
| | 270 | + } |
| | 271 | + |
| | 272 | + public void updateNCharacterStream(int columnIndex, Reader reader) throws SQLException { |
| | 273 | + throw new SQLException("Not implemented."); |
| | 274 | + } |
| | 275 | + |
| | 276 | + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { |
| | 277 | + throw new SQLException("Not implemented."); |
| | 278 | + } |
| | 279 | + |
| | 280 | + public void updateAsciiStream(int columnIndex, InputStream inputStream) throws SQLException { |
| | 281 | + throw new SQLException("Not implemented."); |
| | 282 | + } |
| | 283 | + |
| | 284 | + public void updateBinaryStream(int columnIndex, InputStream inputStream) throws SQLException { |
| | 285 | + throw new SQLException("Not implemented."); |
| | 286 | + } |
| | 287 | + |
| | 288 | + public void updateCharacterStream(int columnIndex, Reader reader) throws SQLException { |
| | 289 | + throw new SQLException("Not implemented."); |
| | 290 | + } |
| | 291 | + |
| | 292 | + public void updateAsciiStream(String columnLabel, InputStream inputStream) throws SQLException { |
| | 293 | + throw new SQLException("Not implemented."); |
| | 294 | + } |
| | 295 | + |
| | 296 | + public void updateBinaryStream(String columnLabel, InputStream inputStream) throws SQLException { |
| | 297 | + throw new SQLException("Not implemented."); |
| | 298 | + } |
| | 299 | + |
| | 300 | + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { |
| | 301 | + throw new SQLException("Not implemented."); |
| | 302 | + } |
| | 303 | + |
| | 304 | + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { |
| | 305 | + throw new SQLException("Not implemented."); |
| | 306 | + } |
| | 307 | + |
| | 308 | + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { |
| | 309 | + throw new SQLException("Not implemented."); |
| | 310 | + } |
| | 311 | + |
| | 312 | + public void updateClob(int columnIndex, Reader reader) throws SQLException { |
| | 313 | + throw new SQLException("Not implemented."); |
| | 314 | + } |
| | 315 | + |
| | 316 | + public void updateClob(String columnLabel, Reader reader) throws SQLException { |
| | 317 | + throw new SQLException("Not implemented."); |
| | 318 | + } |
| | 319 | + |
| | 320 | + public void updateNClob(int columnIndex, Reader reader) throws SQLException { |
| | 321 | + throw new SQLException("Not implemented."); |
| | 322 | + } |
| | 323 | + |
| | 324 | + public void updateNClob(String columnLabel, Reader reader) throws SQLException { |
| | 325 | + throw new SQLException("Not implemented."); |
| | 326 | + } |
| | 327 | +/* JDBC_4_ANT_KEY_END */ |
| | 328 | } |
| | 329 | Index: src/test/org/apache/commons/dbcp/TesterConnection.java |
| | 330 | =================================================================== |
| | 331 | --- src/test/org/apache/commons/dbcp/TesterConnection.java (revision 558600) |
| | 332 | +++ src/test/org/apache/commons/dbcp/TesterConnection.java (working copy) |
| | 333 | @@ -25,6 +25,16 @@ |
| | 334 | import java.sql.SQLWarning; |
| | 335 | import java.sql.Statement; |
| | 336 | import java.util.Map; |
| | 337 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 338 | +import java.sql.Array; |
| | 339 | +import java.sql.Blob; |
| | 340 | +import java.sql.Clob; |
| | 341 | +import java.sql.NClob; |
| | 342 | +import java.sql.SQLClientInfoException; |
| | 343 | +import java.sql.SQLXML; |
| | 344 | +import java.sql.Struct; |
| | 345 | +import java.util.Properties; |
| | 346 | +/* JDBC_4_ANT_KEY_END */ |
| | 347 | |
| | 348 | /** |
| | 349 | * A dummy {@link Connection}, for testing purposes. |
| | 350 | @@ -274,6 +284,59 @@ |
| | 351 | throws SQLException { |
| | 352 | return prepareStatement(sql); |
| | 353 | } |
| | 354 | +/* JDBC_3_ANT_KEY_END */ |
| | 355 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 356 | |
| | 357 | -/* JDBC_3_ANT_KEY_END */ |
| | 358 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 359 | + throw new SQLException("Not implemented."); |
| | 360 | + } |
| | 361 | + |
| | 362 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 363 | + throw new SQLException("Not implemented."); |
| | 364 | + } |
| | 365 | + |
| | 366 | + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { |
| | 367 | + throw new SQLException("Not implemented."); |
| | 368 | + } |
| | 369 | + |
| | 370 | + public Blob createBlob() throws SQLException { |
| | 371 | + throw new SQLException("Not implemented."); |
| | 372 | + } |
| | 373 | + |
| | 374 | + public Clob createClob() throws SQLException { |
| | 375 | + throw new SQLException("Not implemented."); |
| | 376 | + } |
| | 377 | + |
| | 378 | + public NClob createNClob() throws SQLException { |
| | 379 | + throw new SQLException("Not implemented."); |
| | 380 | + } |
| | 381 | + |
| | 382 | + public SQLXML createSQLXML() throws SQLException { |
| | 383 | + throw new SQLException("Not implemented."); |
| | 384 | + } |
| | 385 | + |
| | 386 | + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { |
| | 387 | + throw new SQLException("Not implemented."); |
| | 388 | + } |
| | 389 | + |
| | 390 | + public boolean isValid(int timeout) throws SQLException { |
| | 391 | + throw new SQLException("Not implemented."); |
| | 392 | + } |
| | 393 | + |
| | 394 | + public void setClientInfo(String name, String value) throws SQLClientInfoException { |
| | 395 | + throw new SQLClientInfoException(); |
| | 396 | + } |
| | 397 | + |
| | 398 | + public void setClientInfo(Properties properties) throws SQLClientInfoException { |
| | 399 | + throw new SQLClientInfoException(); |
| | 400 | + } |
| | 401 | + |
| | 402 | + public Properties getClientInfo() throws SQLException { |
| | 403 | + throw new SQLException("Not implemented."); |
| | 404 | + } |
| | 405 | + |
| | 406 | + public String getClientInfo(String name) throws SQLException { |
| | 407 | + throw new SQLException("Not implemented."); |
| | 408 | + } |
| | 409 | +/* JDBC_4_ANT_KEY_END */ |
| | 410 | } |
| | 411 | Index: src/test/org/apache/commons/dbcp/TesterStatement.java |
| | 412 | =================================================================== |
| | 413 | --- src/test/org/apache/commons/dbcp/TesterStatement.java (revision 558600) |
| | 414 | +++ src/test/org/apache/commons/dbcp/TesterStatement.java (working copy) |
| | 415 | @@ -268,5 +268,26 @@ |
| | 416 | throw new SQLException("Not implemented."); |
| | 417 | } |
| | 418 | /* JDBC_3_ANT_KEY_END */ |
| | 419 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 420 | |
| | 421 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 422 | + throw new SQLException("Not implemented."); |
| | 423 | + } |
| | 424 | + |
| | 425 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 426 | + throw new SQLException("Not implemented."); |
| | 427 | + } |
| | 428 | + |
| | 429 | + public boolean isClosed() throws SQLException { |
| | 430 | + throw new SQLException("Not implemented."); |
| | 431 | + } |
| | 432 | + |
| | 433 | + public void setPoolable(boolean poolable) throws SQLException { |
| | 434 | + throw new SQLException("Not implemented."); |
| | 435 | + } |
| | 436 | + |
| | 437 | + public boolean isPoolable() throws SQLException { |
| | 438 | + throw new SQLException("Not implemented."); |
| | 439 | + } |
| | 440 | +/* JDBC_4_ANT_KEY_END */ |
| | 441 | } |
| | 442 | Index: src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java |
| | 443 | =================================================================== |
| | 444 | --- src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java (revision 558600) |
| | 445 | +++ src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java (working copy) |
| | 446 | @@ -32,6 +32,11 @@ |
| | 447 | import java.io.InputStream; |
| | 448 | import java.io.Reader; |
| | 449 | import java.sql.SQLException; |
| | 450 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 451 | +import java.sql.NClob; |
| | 452 | +import java.sql.RowId; |
| | 453 | +import java.sql.SQLXML; |
| | 454 | +/* JDBC_4_ANT_KEY_END */ |
| | 455 | |
| | 456 | /** |
| | 457 | * A base delegating implementation of {@link CallableStatement}. |
| | 458 | @@ -332,6 +337,337 @@ |
| | 459 | |
| | 460 | public URL getURL(String parameterName) throws SQLException |
| | 461 | { checkOpen(); try { return _stmt.getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } } |
| | 462 | +/* JDBC_3_ANT_KEY_END */ |
| | 463 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 464 | |
| | 465 | -/* JDBC_3_ANT_KEY_END */ |
| | 466 | + public RowId getRowId(int parameterIndex) throws SQLException { |
| | 467 | + checkOpen(); |
| | 468 | + try { |
| | 469 | + return _stmt.getRowId(parameterIndex); |
| | 470 | + } |
| | 471 | + catch (SQLException e) { |
| | 472 | + handleException(e); |
| | 473 | + return null; |
| | 474 | + } |
| | 475 | + } |
| | 476 | + |
| | 477 | + public RowId getRowId(String parameterName) throws SQLException { |
| | 478 | + checkOpen(); |
| | 479 | + try { |
| | 480 | + return _stmt.getRowId(parameterName); |
| | 481 | + } |
| | 482 | + catch (SQLException e) { |
| | 483 | + handleException(e); |
| | 484 | + return null; |
| | 485 | + } |
| | 486 | + } |
| | 487 | + |
| | 488 | + public void setRowId(String parameterName, RowId value) throws SQLException { |
| | 489 | + checkOpen(); |
| | 490 | + try { |
| | 491 | + _stmt.setRowId(parameterName, value); |
| | 492 | + } |
| | 493 | + catch (SQLException e) { |
| | 494 | + handleException(e); |
| | 495 | + } |
| | 496 | + } |
| | 497 | + |
| | 498 | + public void setNString(String parameterName, String value) throws SQLException { |
| | 499 | + checkOpen(); |
| | 500 | + try { |
| | 501 | + _stmt.setNString(parameterName, value); |
| | 502 | + } |
| | 503 | + catch (SQLException e) { |
| | 504 | + handleException(e); |
| | 505 | + } |
| | 506 | + } |
| | 507 | + |
| | 508 | + public void setNCharacterStream(String parameterName, Reader reader, long length) throws SQLException { |
| | 509 | + checkOpen(); |
| | 510 | + try { |
| | 511 | + _stmt.setNCharacterStream(parameterName, reader, length); |
| | 512 | + } |
| | 513 | + catch (SQLException e) { |
| | 514 | + handleException(e); |
| | 515 | + } |
| | 516 | + } |
| | 517 | + |
| | 518 | + public void setNClob(String parameterName, NClob value) throws SQLException { |
| | 519 | + checkOpen(); |
| | 520 | + try { |
| | 521 | + _stmt.setNClob(parameterName, value); |
| | 522 | + } |
| | 523 | + catch (SQLException e) { |
| | 524 | + handleException(e); |
| | 525 | + } |
| | 526 | + } |
| | 527 | + |
| | 528 | + public void setClob(String parameterName, Reader reader, long length) throws SQLException { |
| | 529 | + checkOpen(); |
| | 530 | + try { |
| | 531 | + _stmt.setClob(parameterName, reader, length); |
| | 532 | + } |
| | 533 | + catch (SQLException e) { |
| | 534 | + handleException(e); |
| | 535 | + } |
| | 536 | + } |
| | 537 | + |
| | 538 | + public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException { |
| | 539 | + checkOpen(); |
| | 540 | + try { |
| | 541 | + _stmt.setBlob(parameterName, inputStream, length); |
| | 542 | + } |
| | 543 | + catch (SQLException e) { |
| | 544 | + handleException(e); |
| | 545 | + } |
| | 546 | + } |
| | 547 | + |
| | 548 | + public void setNClob(String parameterName, Reader reader, long length) throws SQLException { |
| | 549 | + checkOpen(); |
| | 550 | + try { |
| | 551 | + _stmt.setNClob(parameterName, reader, length); |
| | 552 | + } |
| | 553 | + catch (SQLException e) { |
| | 554 | + handleException(e); |
| | 555 | + } |
| | 556 | + } |
| | 557 | + |
| | 558 | + public NClob getNClob(int parameterIndex) throws SQLException { |
| | 559 | + checkOpen(); |
| | 560 | + try { |
| | 561 | + return _stmt.getNClob(parameterIndex); |
| | 562 | + } |
| | 563 | + catch (SQLException e) { |
| | 564 | + handleException(e); |
| | 565 | + return null; |
| | 566 | + } |
| | 567 | + } |
| | 568 | + |
| | 569 | + public NClob getNClob(String parameterName) throws SQLException { |
| | 570 | + checkOpen(); |
| | 571 | + try { |
| | 572 | + return _stmt.getNClob(parameterName); |
| | 573 | + } |
| | 574 | + catch (SQLException e) { |
| | 575 | + handleException(e); |
| | 576 | + return null; |
| | 577 | + } |
| | 578 | + } |
| | 579 | + |
| | 580 | + public void setSQLXML(String parameterName, SQLXML value) throws SQLException { |
| | 581 | + checkOpen(); |
| | 582 | + try { |
| | 583 | + _stmt.setSQLXML(parameterName, value); |
| | 584 | + } |
| | 585 | + catch (SQLException e) { |
| | 586 | + handleException(e); |
| | 587 | + } |
| | 588 | + } |
| | 589 | + |
| | 590 | + public SQLXML getSQLXML(int parameterIndex) throws SQLException { |
| | 591 | + checkOpen(); |
| | 592 | + try { |
| | 593 | + return _stmt.getSQLXML(parameterIndex); |
| | 594 | + } |
| | 595 | + catch (SQLException e) { |
| | 596 | + handleException(e); |
| | 597 | + return null; |
| | 598 | + } |
| | 599 | + } |
| | 600 | + |
| | 601 | + public SQLXML getSQLXML(String parameterName) throws SQLException { |
| | 602 | + checkOpen(); |
| | 603 | + try { |
| | 604 | + return _stmt.getSQLXML(parameterName); |
| | 605 | + } |
| | 606 | + catch (SQLException e) { |
| | 607 | + handleException(e); |
| | 608 | + return null; |
| | 609 | + } |
| | 610 | + } |
| | 611 | + |
| | 612 | + public String getNString(int parameterIndex) throws SQLException { |
| | 613 | + checkOpen(); |
| | 614 | + try { |
| | 615 | + return _stmt.getNString(parameterIndex); |
| | 616 | + } |
| | 617 | + catch (SQLException e) { |
| | 618 | + handleException(e); |
| | 619 | + return null; |
| | 620 | + } |
| | 621 | + } |
| | 622 | + |
| | 623 | + public String getNString(String parameterName) throws SQLException { |
| | 624 | + checkOpen(); |
| | 625 | + try { |
| | 626 | + return _stmt.getNString(parameterName); |
| | 627 | + } |
| | 628 | + catch (SQLException e) { |
| | 629 | + handleException(e); |
| | 630 | + return null; |
| | 631 | + } |
| | 632 | + } |
| | 633 | + |
| | 634 | + public Reader getNCharacterStream(int parameterIndex) throws SQLException { |
| | 635 | + checkOpen(); |
| | 636 | + try { |
| | 637 | + return _stmt.getNCharacterStream(parameterIndex); |
| | 638 | + } |
| | 639 | + catch (SQLException e) { |
| | 640 | + handleException(e); |
| | 641 | + return null; |
| | 642 | + } |
| | 643 | + } |
| | 644 | + |
| | 645 | + public Reader getNCharacterStream(String parameterName) throws SQLException { |
| | 646 | + checkOpen(); |
| | 647 | + try { |
| | 648 | + return _stmt.getNCharacterStream(parameterName); |
| | 649 | + } |
| | 650 | + catch (SQLException e) { |
| | 651 | + handleException(e); |
| | 652 | + return null; |
| | 653 | + } |
| | 654 | + } |
| | 655 | + |
| | 656 | + public Reader getCharacterStream(int parameterIndex) throws SQLException { |
| | 657 | + checkOpen(); |
| | 658 | + try { |
| | 659 | + return _stmt.getCharacterStream(parameterIndex); |
| | 660 | + } |
| | 661 | + catch (SQLException e) { |
| | 662 | + handleException(e); |
| | 663 | + return null; |
| | 664 | + } |
| | 665 | + } |
| | 666 | + |
| | 667 | + public Reader getCharacterStream(String parameterName) throws SQLException { |
| | 668 | + checkOpen(); |
| | 669 | + try { |
| | 670 | + return _stmt.getCharacterStream(parameterName); |
| | 671 | + } |
| | 672 | + catch (SQLException e) { |
| | 673 | + handleException(e); |
| | 674 | + return null; |
| | 675 | + } |
| | 676 | + } |
| | 677 | + |
| | 678 | + public void setBlob(String parameterName, Blob blob) throws SQLException { |
| | 679 | + checkOpen(); |
| | 680 | + try { |
| | 681 | + _stmt.setBlob(parameterName, blob); |
| | 682 | + } |
| | 683 | + catch (SQLException e) { |
| | 684 | + handleException(e); |
| | 685 | + } |
| | 686 | + } |
| | 687 | + |
| | 688 | + public void setClob(String parameterName, Clob clob) throws SQLException { |
| | 689 | + checkOpen(); |
| | 690 | + try { |
| | 691 | + _stmt.setClob(parameterName, clob); |
| | 692 | + } |
| | 693 | + catch (SQLException e) { |
| | 694 | + handleException(e); |
| | 695 | + } |
| | 696 | + } |
| | 697 | + |
| | 698 | + public void setAsciiStream(String parameterName, InputStream inputStream, long length) throws SQLException { |
| | 699 | + checkOpen(); |
| | 700 | + try { |
| | 701 | + _stmt.setAsciiStream(parameterName, inputStream, length); |
| | 702 | + } |
| | 703 | + catch (SQLException e) { |
| | 704 | + handleException(e); |
| | 705 | + } |
| | 706 | + } |
| | 707 | + |
| | 708 | + public void setBinaryStream(String parameterName, InputStream inputStream, long length) throws SQLException { |
| | 709 | + checkOpen(); |
| | 710 | + try { |
| | 711 | + _stmt.setBinaryStream(parameterName, inputStream, length); |
| | 712 | + } |
| | 713 | + catch (SQLException e) { |
| | 714 | + handleException(e); |
| | 715 | + } |
| | 716 | + } |
| | 717 | + |
| | 718 | + public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException { |
| | 719 | + checkOpen(); |
| | 720 | + try { |
| | 721 | + _stmt.setCharacterStream(parameterName, reader, length); |
| | 722 | + } |
| | 723 | + catch (SQLException e) { |
| | 724 | + handleException(e); |
| | 725 | + } |
| | 726 | + } |
| | 727 | + |
| | 728 | + public void setAsciiStream(String parameterName, InputStream inputStream) throws SQLException { |
| | 729 | + checkOpen(); |
| | 730 | + try { |
| | 731 | + _stmt.setAsciiStream(parameterName, inputStream); |
| | 732 | + } |
| | 733 | + catch (SQLException e) { |
| | 734 | + handleException(e); |
| | 735 | + } |
| | 736 | + } |
| | 737 | + |
| | 738 | + public void setBinaryStream(String parameterName, InputStream inputStream) throws SQLException { |
| | 739 | + checkOpen(); |
| | 740 | + try { |
| | 741 | + _stmt.setBinaryStream(parameterName, inputStream); |
| | 742 | + } |
| | 743 | + catch (SQLException e) { |
| | 744 | + handleException(e); |
| | 745 | + } |
| | 746 | + } |
| | 747 | + |
| | 748 | + public void setCharacterStream(String parameterName, Reader reader) throws SQLException { |
| | 749 | + checkOpen(); |
| | 750 | + try { |
| | 751 | + _stmt.setCharacterStream(parameterName, reader); |
| | 752 | + } |
| | 753 | + catch (SQLException e) { |
| | 754 | + handleException(e); |
| | 755 | + } |
| | 756 | + } |
| | 757 | + |
| | 758 | + public void setNCharacterStream(String parameterName, Reader reader) throws SQLException { |
| | 759 | + checkOpen(); |
| | 760 | + try { |
| | 761 | + _stmt.setNCharacterStream(parameterName, reader); |
| | 762 | + } |
| | 763 | + catch (SQLException e) { |
| | 764 | + handleException(e); |
| | 765 | + } |
| | 766 | + } |
| | 767 | + |
| | 768 | + public void setClob(String parameterName, Reader reader) throws SQLException { |
| | 769 | + checkOpen(); |
| | 770 | + try { |
| | 771 | + _stmt.setClob(parameterName, reader); |
| | 772 | + } |
| | 773 | + catch (SQLException e) { |
| | 774 | + handleException(e); |
| | 775 | + } } |
| | 776 | + |
| | 777 | + public void setBlob(String parameterName, InputStream inputStream) throws SQLException { |
| | 778 | + checkOpen(); |
| | 779 | + try { |
| | 780 | + _stmt.setBlob(parameterName, inputStream); |
| | 781 | + } |
| | 782 | + catch (SQLException e) { |
| | 783 | + handleException(e); |
| | 784 | + } } |
| | 785 | + |
| | 786 | + public void setNClob(String parameterName, Reader reader) throws SQLException { |
| | 787 | + checkOpen(); |
| | 788 | + try { |
| | 789 | + _stmt.setNClob(parameterName, reader); |
| | 790 | + } |
| | 791 | + catch (SQLException e) { |
| | 792 | + handleException(e); |
| | 793 | + } |
| | 794 | + } |
| | 795 | +/* JDBC_4_ANT_KEY_END */ |
| | 796 | } |
| | 797 | Index: src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java |
| | 798 | =================================================================== |
| | 799 | --- src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java (revision 558600) |
| | 800 | +++ src/java/org/apache/commons/dbcp/cpdsadapter/ConnectionImpl.java (working copy) |
| | 801 | @@ -25,6 +25,19 @@ |
| | 802 | import java.sql.Statement; |
| | 803 | import java.sql.SQLWarning; |
| | 804 | import java.sql.SQLException; |
| | 805 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 806 | +import java.sql.Array; |
| | 807 | +import java.sql.Blob; |
| | 808 | +import java.sql.ClientInfoStatus; |
| | 809 | +import java.sql.Clob; |
| | 810 | +import java.sql.NClob; |
| | 811 | +import java.sql.SQLClientInfoException; |
| | 812 | +import java.sql.SQLXML; |
| | 813 | +import java.sql.Struct; |
| | 814 | +import java.util.Collections; |
| | 815 | +import java.util.Map; |
| | 816 | +import java.util.Properties; |
| | 817 | +/* JDBC_4_ANT_KEY_END */ |
| | 818 | |
| | 819 | /** |
| | 820 | * This class is the <code>Connection</code> that will be returned |
| | 821 | @@ -42,6 +55,11 @@ |
| | 822 | private static final String CLOSED |
| | 823 | = "Attempted to use Connection after closed() was called."; |
| | 824 | |
| | 825 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 826 | + private static final Map<String, ClientInfoStatus> EMPTY_FAILED_PROPERTIES = |
| | 827 | + Collections.<String, ClientInfoStatus>emptyMap(); |
| | 828 | +/* JDBC_4_ANT_KEY_END */ |
| | 829 | + |
| | 830 | /** The JDBC database connection. */ |
| | 831 | private Connection connection; |
| | 832 | |
| | 833 | @@ -453,6 +471,86 @@ |
| | 834 | assertOpen(); |
| | 835 | return connection.prepareStatement(sql, columnNames); |
| | 836 | } |
| | 837 | +/* JDBC_3_ANT_KEY_END */ |
| | 838 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 839 | |
| | 840 | -/* JDBC_3_ANT_KEY_END */ |
| | 841 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 842 | + return connection.isWrapperFor(iface); |
| | 843 | + } |
| | 844 | + |
| | 845 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 846 | + return connection.unwrap(iface); |
| | 847 | + } |
| | 848 | + |
| | 849 | + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { |
| | 850 | + assertOpen(); |
| | 851 | + return connection.createArrayOf(typeName, elements); |
| | 852 | + } |
| | 853 | + |
| | 854 | + public Blob createBlob() throws SQLException { |
| | 855 | + assertOpen(); |
| | 856 | + return connection.createBlob(); |
| | 857 | + } |
| | 858 | + |
| | 859 | + public Clob createClob() throws SQLException { |
| | 860 | + assertOpen(); |
| | 861 | + return connection.createClob(); |
| | 862 | + } |
| | 863 | + |
| | 864 | + public NClob createNClob() throws SQLException { |
| | 865 | + assertOpen(); |
| | 866 | + return connection.createNClob(); |
| | 867 | + } |
| | 868 | + |
| | 869 | + public SQLXML createSQLXML() throws SQLException { |
| | 870 | + assertOpen(); |
| | 871 | + return connection.createSQLXML(); |
| | 872 | + } |
| | 873 | + |
| | 874 | + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { |
| | 875 | + assertOpen(); |
| | 876 | + return connection.createStruct(typeName, attributes); |
| | 877 | + } |
| | 878 | + |
| | 879 | + public boolean isValid(int timeout) throws SQLException { |
| | 880 | + assertOpen(); |
| | 881 | + return connection.isValid(timeout); |
| | 882 | + } |
| | 883 | + |
| | 884 | + public void setClientInfo(String name, String value) throws SQLClientInfoException { |
| | 885 | + try { |
| | 886 | + assertOpen(); |
| | 887 | + connection.setClientInfo(name, value); |
| | 888 | + } |
| | 889 | + catch (SQLClientInfoException e) { |
| | 890 | + throw e; |
| | 891 | + } |
| | 892 | + catch (SQLException e) { |
| | 893 | + throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e); |
| | 894 | + } |
| | 895 | + } |
| | 896 | + |
| | 897 | + public void setClientInfo(Properties properties) throws SQLClientInfoException { |
| | 898 | + try { |
| | 899 | + assertOpen(); |
| | 900 | + connection.setClientInfo(properties); |
| | 901 | + } |
| | 902 | + catch (SQLClientInfoException e) { |
| | 903 | + throw e; |
| | 904 | + } |
| | 905 | + catch (SQLException e) { |
| | 906 | + throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e); |
| | 907 | + } |
| | 908 | + } |
| | 909 | + |
| | 910 | + public Properties getClientInfo() throws SQLException { |
| | 911 | + assertOpen(); |
| | 912 | + return connection.getClientInfo(); |
| | 913 | + } |
| | 914 | + |
| | 915 | + public String getClientInfo(String name) throws SQLException { |
| | 916 | + assertOpen(); |
| | 917 | + return connection.getClientInfo(name); |
| | 918 | + } |
| | 919 | +/* JDBC_4_ANT_KEY_END */ |
| | 920 | } |
| | 921 | Index: src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java |
| | 922 | =================================================================== |
| | 923 | --- src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java (revision 558600) |
| | 924 | +++ src/java/org/apache/commons/dbcp/cpdsadapter/PooledConnectionImpl.java (working copy) |
| | 925 | @@ -26,6 +26,7 @@ |
| | 926 | import javax.sql.ConnectionEvent; |
| | 927 | import javax.sql.ConnectionEventListener; |
| | 928 | import javax.sql.PooledConnection; |
| | 929 | +import javax.sql.StatementEventListener; |
| | 930 | |
| | 931 | import org.apache.commons.dbcp.DelegatingConnection; |
| | 932 | import org.apache.commons.dbcp.DelegatingPreparedStatement; |
| | 933 | @@ -66,6 +67,11 @@ |
| | 934 | private Vector eventListeners; |
| | 935 | |
| | 936 | /** |
| | 937 | + * StatementEventListeners |
| | 938 | + */ |
| | 939 | + private Vector statementEventListeners; |
| | 940 | + |
| | 941 | + /** |
| | 942 | * flag set to true, once close() is called. |
| | 943 | */ |
| | 944 | boolean isClosed; |
| | 945 | @@ -101,6 +107,12 @@ |
| | 946 | } |
| | 947 | } |
| | 948 | |
| | 949 | + public void addStatementEventListener(StatementEventListener listener) { |
| | 950 | + if (!statementEventListeners.contains(listener)) { |
| | 951 | + statementEventListeners.add(listener); |
| | 952 | + } |
| | 953 | + } |
| | 954 | + |
| | 955 | /** |
| | 956 | * Closes the physical connection and marks this |
| | 957 | * <code>PooledConnection</code> so that it may not be used |
| | 958 | @@ -169,6 +181,10 @@ |
| | 959 | eventListeners.remove(listener); |
| | 960 | } |
| | 961 | |
| | 962 | + public void removeStatementEventListener(StatementEventListener listener) { |
| | 963 | + statementEventListeners.remove(listener); |
| | 964 | + } |
| | 965 | + |
| | 966 | /** |
| | 967 | * Closes the physical connection and checks that the logical connection |
| | 968 | * was closed as well. |
| | 969 | Index: src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java |
| | 970 | =================================================================== |
| | 971 | --- src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java (revision 558600) |
| | 972 | +++ src/java/org/apache/commons/dbcp/DelegatingPreparedStatement.java (working copy) |
| | 973 | @@ -27,6 +27,13 @@ |
| | 974 | import java.sql.ResultSetMetaData; |
| | 975 | import java.sql.SQLException; |
| | 976 | import java.util.Calendar; |
| | 977 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 978 | +import java.io.InputStream; |
| | 979 | +import java.io.Reader; |
| | 980 | +import java.sql.NClob; |
| | 981 | +import java.sql.RowId; |
| | 982 | +import java.sql.SQLXML; |
| | 983 | +/* JDBC_4_ANT_KEY_END */ |
| | 984 | |
| | 985 | /** |
| | 986 | * A base delegating implementation of {@link PreparedStatement}. |
| | 987 | @@ -221,6 +228,187 @@ |
| | 988 | |
| | 989 | public java.sql.ParameterMetaData getParameterMetaData() throws SQLException |
| | 990 | { checkOpen(); try { return _stmt.getParameterMetaData(); } catch (SQLException e) { handleException(e); return null; } } |
| | 991 | +/* JDBC_3_ANT_KEY_END */ |
| | 992 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 993 | |
| | 994 | -/* JDBC_3_ANT_KEY_END */ |
| | 995 | + public void setRowId(int parameterIndex, RowId value) throws SQLException { |
| | 996 | + checkOpen(); |
| | 997 | + try { |
| | 998 | + _stmt.setRowId(parameterIndex, value); |
| | 999 | + } |
| | 1000 | + catch (SQLException e) { |
| | 1001 | + handleException(e); |
| | 1002 | + } |
| | 1003 | + } |
| | 1004 | + |
| | 1005 | + public void setNString(int parameterIndex, String value) throws SQLException { |
| | 1006 | + checkOpen(); |
| | 1007 | + try { |
| | 1008 | + _stmt.setNString(parameterIndex, value); |
| | 1009 | + } |
| | 1010 | + catch (SQLException e) { |
| | 1011 | + handleException(e); |
| | 1012 | + } |
| | 1013 | + } |
| | 1014 | + |
| | 1015 | + public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException { |
| | 1016 | + checkOpen(); |
| | 1017 | + try { |
| | 1018 | + _stmt.setNCharacterStream(parameterIndex, value, length); |
| | 1019 | + } |
| | 1020 | + catch (SQLException e) { |
| | 1021 | + handleException(e); |
| | 1022 | + } |
| | 1023 | + } |
| | 1024 | + |
| | 1025 | + public void setNClob(int parameterIndex, NClob value) throws SQLException { |
| | 1026 | + checkOpen(); |
| | 1027 | + try { |
| | 1028 | + _stmt.setNClob(parameterIndex, value); |
| | 1029 | + } |
| | 1030 | + catch (SQLException e) { |
| | 1031 | + handleException(e); |
| | 1032 | + } |
| | 1033 | + } |
| | 1034 | + |
| | 1035 | + public void setClob(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 1036 | + checkOpen(); |
| | 1037 | + try { |
| | 1038 | + _stmt.setClob(parameterIndex, reader, length); |
| | 1039 | + } |
| | 1040 | + catch (SQLException e) { |
| | 1041 | + handleException(e); |
| | 1042 | + } |
| | 1043 | + } |
| | 1044 | + |
| | 1045 | + public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 1046 | + checkOpen(); |
| | 1047 | + try { |
| | 1048 | + _stmt.setBlob(parameterIndex, inputStream, length); |
| | 1049 | + } |
| | 1050 | + catch (SQLException e) { |
| | 1051 | + handleException(e); |
| | 1052 | + } |
| | 1053 | + } |
| | 1054 | + |
| | 1055 | + public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 1056 | + checkOpen(); |
| | 1057 | + try { |
| | 1058 | + _stmt.setNClob(parameterIndex, reader, length); |
| | 1059 | + } |
| | 1060 | + catch (SQLException e) { |
| | 1061 | + handleException(e); |
| | 1062 | + } |
| | 1063 | + } |
| | 1064 | + |
| | 1065 | + public void setSQLXML(int parameterIndex, SQLXML value) throws SQLException { |
| | 1066 | + checkOpen(); |
| | 1067 | + try { |
| | 1068 | + _stmt.setSQLXML(parameterIndex, value); |
| | 1069 | + } |
| | 1070 | + catch (SQLException e) { |
| | 1071 | + handleException(e); |
| | 1072 | + } |
| | 1073 | + } |
| | 1074 | + |
| | 1075 | + public void setAsciiStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 1076 | + checkOpen(); |
| | 1077 | + try { |
| | 1078 | + _stmt.setAsciiStream(parameterIndex, inputStream, length); |
| | 1079 | + } |
| | 1080 | + catch (SQLException e) { |
| | 1081 | + handleException(e); |
| | 1082 | + } |
| | 1083 | + } |
| | 1084 | + |
| | 1085 | + public void setBinaryStream(int parameterIndex, InputStream inputStream, long length) throws SQLException { |
| | 1086 | + checkOpen(); |
| | 1087 | + try { |
| | 1088 | + _stmt.setBinaryStream(parameterIndex, inputStream, length); |
| | 1089 | + } |
| | 1090 | + catch (SQLException e) { |
| | 1091 | + handleException(e); |
| | 1092 | + } |
| | 1093 | + } |
| | 1094 | + |
| | 1095 | + public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException { |
| | 1096 | + checkOpen(); |
| | 1097 | + try { |
| | 1098 | + _stmt.setCharacterStream(parameterIndex, reader, length); |
| | 1099 | + } |
| | 1100 | + catch (SQLException e) { |
| | 1101 | + handleException(e); |
| | 1102 | + } |
| | 1103 | + } |
| | 1104 | + |
| | 1105 | + public void setAsciiStream(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 1106 | + checkOpen(); |
| | 1107 | + try { |
| | 1108 | + _stmt.setAsciiStream(parameterIndex, inputStream); |
| | 1109 | + } |
| | 1110 | + catch (SQLException e) { |
| | 1111 | + handleException(e); |
| | 1112 | + } |
| | 1113 | + } |
| | 1114 | + |
| | 1115 | + public void setBinaryStream(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 1116 | + checkOpen(); |
| | 1117 | + try { |
| | 1118 | + _stmt.setBinaryStream(parameterIndex, inputStream); |
| | 1119 | + } |
| | 1120 | + catch (SQLException e) { |
| | 1121 | + handleException(e); |
| | 1122 | + } |
| | 1123 | + } |
| | 1124 | + |
| | 1125 | + public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException { |
| | 1126 | + checkOpen(); |
| | 1127 | + try { |
| | 1128 | + _stmt.setCharacterStream(parameterIndex, reader); |
| | 1129 | + } |
| | 1130 | + catch (SQLException e) { |
| | 1131 | + handleException(e); |
| | 1132 | + } |
| | 1133 | + } |
| | 1134 | + |
| | 1135 | + public void setNCharacterStream(int parameterIndex, Reader reader) throws SQLException { |
| | 1136 | + checkOpen(); |
| | 1137 | + try { |
| | 1138 | + _stmt.setNCharacterStream(parameterIndex, reader); |
| | 1139 | + } |
| | 1140 | + catch (SQLException e) { |
| | 1141 | + handleException(e); |
| | 1142 | + } |
| | 1143 | + } |
| | 1144 | + |
| | 1145 | + public void setClob(int parameterIndex, Reader reader) throws SQLException { |
| | 1146 | + checkOpen(); |
| | 1147 | + try { |
| | 1148 | + _stmt.setClob(parameterIndex, reader); |
| | 1149 | + } |
| | 1150 | + catch (SQLException e) { |
| | 1151 | + handleException(e); |
| | 1152 | + } |
| | 1153 | + } |
| | 1154 | + |
| | 1155 | + public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException { |
| | 1156 | + checkOpen(); |
| | 1157 | + try { |
| | 1158 | + _stmt.setBlob(parameterIndex, inputStream); |
| | 1159 | + } |
| | 1160 | + catch (SQLException e) { |
| | 1161 | + handleException(e); |
| | 1162 | + } |
| | 1163 | + } |
| | 1164 | + |
| | 1165 | + public void setNClob(int parameterIndex, Reader reader) throws SQLException { |
| | 1166 | + checkOpen(); |
| | 1167 | + try { |
| | 1168 | + _stmt.setNClob(parameterIndex, reader); |
| | 1169 | + } |
| | 1170 | + catch (SQLException e) { |
| | 1171 | + handleException(e); |
| | 1172 | + } |
| | 1173 | + } |
| | 1174 | +/* JDBC_4_ANT_KEY_END */ |
| | 1175 | } |
| | 1176 | Index: src/java/org/apache/commons/dbcp/DelegatingResultSet.java |
| | 1177 | =================================================================== |
| | 1178 | --- src/java/org/apache/commons/dbcp/DelegatingResultSet.java (revision 558600) |
| | 1179 | +++ src/java/org/apache/commons/dbcp/DelegatingResultSet.java (working copy) |
| | 1180 | @@ -34,6 +34,11 @@ |
| | 1181 | import java.sql.Clob; |
| | 1182 | import java.sql.Array; |
| | 1183 | import java.util.Calendar; |
| | 1184 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1185 | +import java.sql.NClob; |
| | 1186 | +import java.sql.RowId; |
| | 1187 | +import java.sql.SQLXML; |
| | 1188 | +/* JDBC_4_ANT_KEY_END */ |
| | 1189 | |
| | 1190 | /** |
| | 1191 | * A base delegating implementation of {@link ResultSet}. |
| | 1192 | @@ -585,6 +590,459 @@ |
| | 1193 | |
| | 1194 | public void updateArray(String columnName, java.sql.Array x) throws SQLException |
| | 1195 | { try { _res.updateArray(columnName, x); } catch (SQLException e) { handleException(e); } } |
| | 1196 | +/* JDBC_3_ANT_KEY_END */ |
| | 1197 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1198 | |
| | 1199 | -/* JDBC_3_ANT_KEY_END */ |
| | 1200 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1201 | + return _res.isWrapperFor(iface); |
| | 1202 | + } |
| | 1203 | + |
| | 1204 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1205 | + return _res.unwrap(iface); |
| | 1206 | + } |
| | 1207 | + |
| | 1208 | + public RowId getRowId(int columnIndex) throws SQLException { |
| | 1209 | + try { |
| | 1210 | + return _res.getRowId(columnIndex); |
| | 1211 | + } |
| | 1212 | + catch (SQLException e) { |
| | 1213 | + handleException(e); |
| | 1214 | + return null; |
| | 1215 | + } |
| | 1216 | + } |
| | 1217 | + |
| | 1218 | + public RowId getRowId(String columnLabel) throws SQLException { |
| | 1219 | + try { |
| | 1220 | + return _res.getRowId(columnLabel); |
| | 1221 | + } |
| | 1222 | + catch (SQLException e) { |
| | 1223 | + handleException(e); |
| | 1224 | + return null; |
| | 1225 | + } |
| | 1226 | + } |
| | 1227 | + |
| | 1228 | + public void updateRowId(int columnIndex, RowId value) throws SQLException { |
| | 1229 | + try { |
| | 1230 | + _res.updateRowId(columnIndex, value); |
| | 1231 | + } |
| | 1232 | + catch (SQLException e) { |
| | 1233 | + handleException(e); |
| | 1234 | + } |
| | 1235 | + } |
| | 1236 | + |
| | 1237 | + public void updateRowId(String columnLabel, RowId value) throws SQLException { |
| | 1238 | + try { |
| | 1239 | + _res.updateRowId(columnLabel, value); |
| | 1240 | + } |
| | 1241 | + catch (SQLException e) { |
| | 1242 | + handleException(e); |
| | 1243 | + } |
| | 1244 | + } |
| | 1245 | + |
| | 1246 | + public int getHoldability() throws SQLException { |
| | 1247 | + try { |
| | 1248 | + return _res.getHoldability(); |
| | 1249 | + } |
| | 1250 | + catch (SQLException e) { |
| | 1251 | + handleException(e); |
| | 1252 | + return 0; |
| | 1253 | + } |
| | 1254 | + } |
| | 1255 | + |
| | 1256 | + public boolean isClosed() throws SQLException { |
| | 1257 | + try { |
| | 1258 | + return _res.isClosed(); |
| | 1259 | + } |
| | 1260 | + catch (SQLException e) { |
| | 1261 | + handleException(e); |
| | 1262 | + return false; |
| | 1263 | + } |
| | 1264 | + } |
| | 1265 | + |
| | 1266 | + public void updateNString(int columnIndex, String value) throws SQLException { |
| | 1267 | + try { |
| | 1268 | + _res.updateNString(columnIndex, value); |
| | 1269 | + } |
| | 1270 | + catch (SQLException e) { |
| | 1271 | + handleException(e); |
| | 1272 | + } |
| | 1273 | + } |
| | 1274 | + |
| | 1275 | + public void updateNString(String columnLabel, String value) throws SQLException { |
| | 1276 | + try { |
| | 1277 | + _res.updateNString(columnLabel, value); |
| | 1278 | + } |
| | 1279 | + catch (SQLException e) { |
| | 1280 | + handleException(e); |
| | 1281 | + } |
| | 1282 | + } |
| | 1283 | + |
| | 1284 | + public void updateNClob(int columnIndex, NClob value) throws SQLException { |
| | 1285 | + try { |
| | 1286 | + _res.updateNClob(columnIndex, value); |
| | 1287 | + } |
| | 1288 | + catch (SQLException e) { |
| | 1289 | + handleException(e); |
| | 1290 | + } |
| | 1291 | + } |
| | 1292 | + |
| | 1293 | + public void updateNClob(String columnLabel, NClob value) throws SQLException { |
| | 1294 | + try { |
| | 1295 | + _res.updateNClob(columnLabel, value); |
| | 1296 | + } |
| | 1297 | + catch (SQLException e) { |
| | 1298 | + handleException(e); |
| | 1299 | + } |
| | 1300 | + } |
| | 1301 | + |
| | 1302 | + public NClob getNClob(int columnIndex) throws SQLException { |
| | 1303 | + try { |
| | 1304 | + return _res.getNClob(columnIndex); |
| | 1305 | + } |
| | 1306 | + catch (SQLException e) { |
| | 1307 | + handleException(e); |
| | 1308 | + return null; |
| | 1309 | + } |
| | 1310 | + } |
| | 1311 | + |
| | 1312 | + public NClob getNClob(String columnLabel) throws SQLException { |
| | 1313 | + try { |
| | 1314 | + return _res.getNClob(columnLabel); |
| | 1315 | + } |
| | 1316 | + catch (SQLException e) { |
| | 1317 | + handleException(e); |
| | 1318 | + return null; |
| | 1319 | + } |
| | 1320 | + } |
| | 1321 | + |
| | 1322 | + public SQLXML getSQLXML(int columnIndex) throws SQLException { |
| | 1323 | + try { |
| | 1324 | + return _res.getSQLXML(columnIndex); |
| | 1325 | + } |
| | 1326 | + catch (SQLException e) { |
| | 1327 | + handleException(e); |
| | 1328 | + return null; |
| | 1329 | + } |
| | 1330 | + } |
| | 1331 | + |
| | 1332 | + public SQLXML getSQLXML(String columnLabel) throws SQLException { |
| | 1333 | + try { |
| | 1334 | + return _res.getSQLXML(columnLabel); |
| | 1335 | + } |
| | 1336 | + catch (SQLException e) { |
| | 1337 | + handleException(e); |
| | 1338 | + return null; |
| | 1339 | + } |
| | 1340 | + } |
| | 1341 | + |
| | 1342 | + public void updateSQLXML(int columnIndex, SQLXML value) throws SQLException { |
| | 1343 | + try { |
| | 1344 | + _res.updateSQLXML(columnIndex, value); |
| | 1345 | + } |
| | 1346 | + catch (SQLException e) { |
| | 1347 | + handleException(e); |
| | 1348 | + } |
| | 1349 | + } |
| | 1350 | + |
| | 1351 | + public void updateSQLXML(String columnLabel, SQLXML value) throws SQLException { |
| | 1352 | + try { |
| | 1353 | + _res.updateSQLXML(columnLabel, value); |
| | 1354 | + } |
| | 1355 | + catch (SQLException e) { |
| | 1356 | + handleException(e); |
| | 1357 | + } |
| | 1358 | + } |
| | 1359 | + |
| | 1360 | + public String getNString(int columnIndex) throws SQLException { |
| | 1361 | + try { |
| | 1362 | + return _res.getNString(columnIndex); |
| | 1363 | + } |
| | 1364 | + catch (SQLException e) { |
| | 1365 | + handleException(e); |
| | 1366 | + return null; |
| | 1367 | + } |
| | 1368 | + } |
| | 1369 | + |
| | 1370 | + public String getNString(String columnLabel) throws SQLException { |
| | 1371 | + try { |
| | 1372 | + return _res.getNString(columnLabel); |
| | 1373 | + } |
| | 1374 | + catch (SQLException e) { |
| | 1375 | + handleException(e); |
| | 1376 | + return null; |
| | 1377 | + } |
| | 1378 | + } |
| | 1379 | + |
| | 1380 | + public Reader getNCharacterStream(int columnIndex) throws SQLException { |
| | 1381 | + try { |
| | 1382 | + return _res.getNCharacterStream(columnIndex); |
| | 1383 | + } |
| | 1384 | + catch (SQLException e) { |
| | 1385 | + handleException(e); |
| | 1386 | + return null; |
| | 1387 | + } |
| | 1388 | + } |
| | 1389 | + |
| | 1390 | + public Reader getNCharacterStream(String columnLabel) throws SQLException { |
| | 1391 | + try { |
| | 1392 | + return _res.getNCharacterStream(columnLabel); |
| | 1393 | + } |
| | 1394 | + catch (SQLException e) { |
| | 1395 | + handleException(e); |
| | 1396 | + return null; |
| | 1397 | + } |
| | 1398 | + } |
| | 1399 | + |
| | 1400 | + public void updateNCharacterStream(int columnIndex, Reader reader, long length) throws SQLException { |
| | 1401 | + try { |
| | 1402 | + _res.updateNCharacterStream(columnIndex, reader, length); |
| | 1403 | + } |
| | 1404 | + catch (SQLException e) { |
| | 1405 | + handleException(e); |
| | 1406 | + } |
| | 1407 | + } |
| | 1408 | + |
| | 1409 | + public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { |
| | 1410 | + try { |
| | 1411 | + _res.updateNCharacterStream(columnLabel, reader, length); |
| | 1412 | + } |
| | 1413 | + catch (SQLException e) { |
| | 1414 | + handleException(e); |
| | 1415 | + } |
| | 1416 | + } |
| | 1417 | + |
| | 1418 | + public void updateAsciiStream(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 1419 | + try { |
| | 1420 | + _res.updateAsciiStream(columnIndex, inputStream, length); |
| | 1421 | + } |
| | 1422 | + catch (SQLException e) { |
| | 1423 | + handleException(e); |
| | 1424 | + } |
| | 1425 | + } |
| | 1426 | + |
| | 1427 | + public void updateBinaryStream(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 1428 | + try { |
| | 1429 | + _res.updateBinaryStream(columnIndex, inputStream, length); |
| | 1430 | + } |
| | 1431 | + catch (SQLException e) { |
| | 1432 | + handleException(e); |
| | 1433 | + } |
| | 1434 | + } |
| | 1435 | + |
| | 1436 | + public void updateCharacterStream(int columnIndex, Reader reader, long length) throws SQLException { |
| | 1437 | + try { |
| | 1438 | + _res.updateCharacterStream(columnIndex, reader, length); |
| | 1439 | + } |
| | 1440 | + catch (SQLException e) { |
| | 1441 | + handleException(e); |
| | 1442 | + } |
| | 1443 | + } |
| | 1444 | + |
| | 1445 | + public void updateAsciiStream(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 1446 | + try { |
| | 1447 | + _res.updateAsciiStream(columnLabel, inputStream, length); |
| | 1448 | + } |
| | 1449 | + catch (SQLException e) { |
| | 1450 | + handleException(e); |
| | 1451 | + } |
| | 1452 | + } |
| | 1453 | + |
| | 1454 | + public void updateBinaryStream(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 1455 | + try { |
| | 1456 | + _res.updateBinaryStream(columnLabel, inputStream, length); |
| | 1457 | + } |
| | 1458 | + catch (SQLException e) { |
| | 1459 | + handleException(e); |
| | 1460 | + } |
| | 1461 | + } |
| | 1462 | + |
| | 1463 | + public void updateCharacterStream(String columnLabel, Reader reader, long length) throws SQLException { |
| | 1464 | + try { |
| | 1465 | + _res.updateCharacterStream(columnLabel, reader, length); |
| | 1466 | + } |
| | 1467 | + catch (SQLException e) { |
| | 1468 | + handleException(e); |
| | 1469 | + } |
| | 1470 | + } |
| | 1471 | + |
| | 1472 | + public void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException { |
| | 1473 | + try { |
| | 1474 | + _res.updateBlob(columnIndex, inputStream, length); |
| | 1475 | + } |
| | 1476 | + catch (SQLException e) { |
| | 1477 | + handleException(e); |
| | 1478 | + } |
| | 1479 | + } |
| | 1480 | + |
| | 1481 | + public void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException { |
| | 1482 | + try { |
| | 1483 | + _res.updateBlob(columnLabel, inputStream, length); |
| | 1484 | + } |
| | 1485 | + catch (SQLException e) { |
| | 1486 | + handleException(e); |
| | 1487 | + } |
| | 1488 | + } |
| | 1489 | + |
| | 1490 | + public void updateClob(int columnIndex, Reader reader, long length) throws SQLException { |
| | 1491 | + try { |
| | 1492 | + _res.updateClob(columnIndex, reader, length); |
| | 1493 | + } |
| | 1494 | + catch (SQLException e) { |
| | 1495 | + handleException(e); |
| | 1496 | + } |
| | 1497 | + } |
| | 1498 | + |
| | 1499 | + public void updateClob(String columnLabel, Reader reader, long length) throws SQLException { |
| | 1500 | + try { |
| | 1501 | + _res.updateClob(columnLabel, reader, length); |
| | 1502 | + } |
| | 1503 | + catch (SQLException e) { |
| | 1504 | + handleException(e); |
| | 1505 | + } |
| | 1506 | + } |
| | 1507 | + |
| | 1508 | + public void updateNClob(int columnIndex, Reader reader, long length) throws SQLException { |
| | 1509 | + try { |
| | 1510 | + _res.updateNClob(columnIndex, reader, length); |
| | 1511 | + } |
| | 1512 | + catch (SQLException e) { |
| | 1513 | + handleException(e); |
| | 1514 | + } |
| | 1515 | + } |
| | 1516 | + |
| | 1517 | + public void updateNClob(String columnLabel, Reader reader, long length) throws SQLException { |
| | 1518 | + try { |
| | 1519 | + _res.updateNClob(columnLabel, reader, length); |
| | 1520 | + } |
| | 1521 | + catch (SQLException e) { |
| | 1522 | + handleException(e); |
| | 1523 | + } |
| | 1524 | + } |
| | 1525 | + |
| | 1526 | + public void updateNCharacterStream(int columnIndex, Reader reader) throws SQLException { |
| | 1527 | + try { |
| | 1528 | + _res.updateNCharacterStream(columnIndex, reader); |
| | 1529 | + } |
| | 1530 | + catch (SQLException e) { |
| | 1531 | + handleException(e); |
| | 1532 | + } |
| | 1533 | + } |
| | 1534 | + |
| | 1535 | + public void updateNCharacterStream(String columnLabel, Reader reader) throws SQLException { |
| | 1536 | + try { |
| | 1537 | + _res.updateNCharacterStream(columnLabel, reader); |
| | 1538 | + } |
| | 1539 | + catch (SQLException e) { |
| | 1540 | + handleException(e); |
| | 1541 | + } |
| | 1542 | + } |
| | 1543 | + |
| | 1544 | + public void updateAsciiStream(int columnIndex, InputStream inputStream) throws SQLException { |
| | 1545 | + try { |
| | 1546 | + _res.updateAsciiStream(columnIndex, inputStream); |
| | 1547 | + } |
| | 1548 | + catch (SQLException e) { |
| | 1549 | + handleException(e); |
| | 1550 | + } |
| | 1551 | + } |
| | 1552 | + |
| | 1553 | + public void updateBinaryStream(int columnIndex, InputStream inputStream) throws SQLException { |
| | 1554 | + try { |
| | 1555 | + _res.updateBinaryStream(columnIndex, inputStream); |
| | 1556 | + } |
| | 1557 | + catch (SQLException e) { |
| | 1558 | + handleException(e); |
| | 1559 | + } |
| | 1560 | + } |
| | 1561 | + |
| | 1562 | + public void updateCharacterStream(int columnIndex, Reader reader) throws SQLException { |
| | 1563 | + try { |
| | 1564 | + _res.updateCharacterStream(columnIndex, reader); |
| | 1565 | + } |
| | 1566 | + catch (SQLException e) { |
| | 1567 | + handleException(e); |
| | 1568 | + } |
| | 1569 | + } |
| | 1570 | + |
| | 1571 | + public void updateAsciiStream(String columnLabel, InputStream inputStream) throws SQLException { |
| | 1572 | + try { |
| | 1573 | + _res.updateAsciiStream(columnLabel, inputStream); |
| | 1574 | + } |
| | 1575 | + catch (SQLException e) { |
| | 1576 | + handleException(e); |
| | 1577 | + } |
| | 1578 | + } |
| | 1579 | + |
| | 1580 | + public void updateBinaryStream(String columnLabel, InputStream inputStream) throws SQLException { |
| | 1581 | + try { |
| | 1582 | + _res.updateBinaryStream(columnLabel, inputStream); |
| | 1583 | + } |
| | 1584 | + catch (SQLException e) { |
| | 1585 | + handleException(e); |
| | 1586 | + } |
| | 1587 | + } |
| | 1588 | + |
| | 1589 | + public void updateCharacterStream(String columnLabel, Reader reader) throws SQLException { |
| | 1590 | + try { |
| | 1591 | + _res.updateCharacterStream(columnLabel, reader); |
| | 1592 | + } |
| | 1593 | + catch (SQLException e) { |
| | 1594 | + handleException(e); |
| | 1595 | + } |
| | 1596 | + } |
| | 1597 | + |
| | 1598 | + public void updateBlob(int columnIndex, InputStream inputStream) throws SQLException { |
| | 1599 | + try { |
| | 1600 | + _res.updateBlob(columnIndex, inputStream); |
| | 1601 | + } |
| | 1602 | + catch (SQLException e) { |
| | 1603 | + handleException(e); |
| | 1604 | + } |
| | 1605 | + } |
| | 1606 | + |
| | 1607 | + public void updateBlob(String columnLabel, InputStream inputStream) throws SQLException { |
| | 1608 | + try { |
| | 1609 | + _res.updateBlob(columnLabel, inputStream); |
| | 1610 | + } |
| | 1611 | + catch (SQLException e) { |
| | 1612 | + handleException(e); |
| | 1613 | + } |
| | 1614 | + } |
| | 1615 | + |
| | 1616 | + public void updateClob(int columnIndex, Reader reader) throws SQLException { |
| | 1617 | + try { |
| | 1618 | + _res.updateClob(columnIndex, reader); |
| | 1619 | + } |
| | 1620 | + catch (SQLException e) { |
| | 1621 | + handleException(e); |
| | 1622 | + } |
| | 1623 | + } |
| | 1624 | + |
| | 1625 | + public void updateClob(String columnLabel, Reader reader) throws SQLException { |
| | 1626 | + try { |
| | 1627 | + _res.updateClob(columnLabel, reader); |
| | 1628 | + } |
| | 1629 | + catch (SQLException e) { |
| | 1630 | + handleException(e); |
| | 1631 | + } |
| | 1632 | + } |
| | 1633 | + |
| | 1634 | + public void updateNClob(int columnIndex, Reader reader) throws SQLException { |
| | 1635 | + try { |
| | 1636 | + _res.updateNClob(columnIndex, reader); |
| | 1637 | + } |
| | 1638 | + catch (SQLException e) { |
| | 1639 | + handleException(e); |
| | 1640 | + } |
| | 1641 | + } |
| | 1642 | + |
| | 1643 | + public void updateNClob(String columnLabel, Reader reader) throws SQLException { |
| | 1644 | + try { |
| | 1645 | + _res.updateNClob(columnLabel, reader); |
| | 1646 | + } |
| | 1647 | + catch (SQLException e) { |
| | 1648 | + handleException(e); |
| | 1649 | + } |
| | 1650 | + } |
| | 1651 | +/* JDBC_4_ANT_KEY_END */ |
| | 1652 | } |
| | 1653 | Index: src/java/org/apache/commons/dbcp/PoolingDataSource.java |
| | 1654 | =================================================================== |
| | 1655 | --- src/java/org/apache/commons/dbcp/PoolingDataSource.java (revision 558600) |
| | 1656 | +++ src/java/org/apache/commons/dbcp/PoolingDataSource.java (working copy) |
| | 1657 | @@ -84,6 +84,14 @@ |
| | 1658 | public void setAccessToUnderlyingConnectionAllowed(boolean allow) { |
| | 1659 | this.accessToUnderlyingConnectionAllowed = allow; |
| | 1660 | } |
| | 1661 | + |
| | 1662 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1663 | + return false; |
| | 1664 | + } |
| | 1665 | + |
| | 1666 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1667 | + throw new SQLException("PoolingDataSource is not a wrapper."); |
| | 1668 | + } |
| | 1669 | |
| | 1670 | //--- DataSource methods ----------------------------------------- |
| | 1671 | |
| | 1672 | Index: src/java/org/apache/commons/dbcp/DelegatingConnection.java |
| | 1673 | =================================================================== |
| | 1674 | --- src/java/org/apache/commons/dbcp/DelegatingConnection.java (revision 558600) |
| | 1675 | +++ src/java/org/apache/commons/dbcp/DelegatingConnection.java (working copy) |
| | 1676 | @@ -26,6 +26,19 @@ |
| | 1677 | import java.sql.Statement; |
| | 1678 | import java.util.List; |
| | 1679 | import java.util.Map; |
| | 1680 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1681 | +import java.sql.Array; |
| | 1682 | +import java.sql.Blob; |
| | 1683 | +import java.sql.ClientInfoStatus; |
| | 1684 | +import java.sql.Clob; |
| | 1685 | +import java.sql.NClob; |
| | 1686 | +import java.sql.SQLClientInfoException; |
| | 1687 | +import java.sql.SQLXML; |
| | 1688 | +import java.sql.Struct; |
| | 1689 | +import java.util.Collections; |
| | 1690 | +import java.util.Map; |
| | 1691 | +import java.util.Properties; |
| | 1692 | +/* JDBC_4_ANT_KEY_END */ |
| | 1693 | |
| | 1694 | /** |
| | 1695 | * A base delegating implementation of {@link Connection}. |
| | 1696 | @@ -50,6 +63,10 @@ |
| | 1697 | */ |
| | 1698 | public class DelegatingConnection extends AbandonedTrace |
| | 1699 | implements Connection { |
| | 1700 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1701 | + private static final Map<String, ClientInfoStatus> EMPTY_FAILED_PROPERTIES = |
| | 1702 | + Collections.<String, ClientInfoStatus>emptyMap(); |
| | 1703 | +/* JDBC_4_ANT_KEY_END */ |
| | 1704 | /** My delegate {@link Connection}. */ |
| | 1705 | protected Connection _conn = null; |
| | 1706 | |
| | 1707 | @@ -495,4 +512,139 @@ |
| | 1708 | } |
| | 1709 | } |
| | 1710 | /* JDBC_3_ANT_KEY_END */ |
| | 1711 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1712 | + |
| | 1713 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1714 | + return _conn.isWrapperFor(iface); |
| | 1715 | + } |
| | 1716 | + |
| | 1717 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1718 | + return _conn.unwrap(iface); |
| | 1719 | + } |
| | 1720 | + |
| | 1721 | + public Array createArrayOf(String typeName, Object[] elements) throws SQLException { |
| | 1722 | + checkOpen(); |
| | 1723 | + try { |
| | 1724 | + return _conn.createArrayOf(typeName, elements); |
| | 1725 | + } |
| | 1726 | + catch (SQLException e) { |
| | 1727 | + handleException(e); |
| | 1728 | + return null; |
| | 1729 | + } |
| | 1730 | + } |
| | 1731 | + |
| | 1732 | + public Blob createBlob() throws SQLException { |
| | 1733 | + checkOpen(); |
| | 1734 | + try { |
| | 1735 | + return _conn.createBlob(); |
| | 1736 | + } |
| | 1737 | + catch (SQLException e) { |
| | 1738 | + handleException(e); |
| | 1739 | + return null; |
| | 1740 | + } |
| | 1741 | + } |
| | 1742 | + |
| | 1743 | + public Clob createClob() throws SQLException { |
| | 1744 | + checkOpen(); |
| | 1745 | + try { |
| | 1746 | + return _conn.createClob(); |
| | 1747 | + } |
| | 1748 | + catch (SQLException e) { |
| | 1749 | + handleException(e); |
| | 1750 | + return null; |
| | 1751 | + } |
| | 1752 | + } |
| | 1753 | + |
| | 1754 | + public NClob createNClob() throws SQLException { |
| | 1755 | + checkOpen(); |
| | 1756 | + try { |
| | 1757 | + return _conn.createNClob(); |
| | 1758 | + } |
| | 1759 | + catch (SQLException e) { |
| | 1760 | + handleException(e); |
| | 1761 | + return null; |
| | 1762 | + } |
| | 1763 | + } |
| | 1764 | + |
| | 1765 | + public SQLXML createSQLXML() throws SQLException { |
| | 1766 | + checkOpen(); |
| | 1767 | + try { |
| | 1768 | + return _conn.createSQLXML(); |
| | 1769 | + } |
| | 1770 | + catch (SQLException e) { |
| | 1771 | + handleException(e); |
| | 1772 | + return null; |
| | 1773 | + } |
| | 1774 | + } |
| | 1775 | + |
| | 1776 | + public Struct createStruct(String typeName, Object[] attributes) throws SQLException { |
| | 1777 | + checkOpen(); |
| | 1778 | + try { |
| | 1779 | + return _conn.createStruct(typeName, attributes); |
| | 1780 | + } |
| | 1781 | + catch (SQLException e) { |
| | 1782 | + handleException(e); |
| | 1783 | + return null; |
| | 1784 | + } |
| | 1785 | + } |
| | 1786 | + |
| | 1787 | + public boolean isValid(int timeout) throws SQLException { |
| | 1788 | + checkOpen(); |
| | 1789 | + try { |
| | 1790 | + return _conn.isValid(timeout); |
| | 1791 | + } |
| | 1792 | + catch (SQLException e) { |
| | 1793 | + handleException(e); |
| | 1794 | + return false; |
| | 1795 | + } |
| | 1796 | + } |
| | 1797 | + |
| | 1798 | + public void setClientInfo(String name, String value) throws SQLClientInfoException { |
| | 1799 | + try { |
| | 1800 | + checkOpen(); |
| | 1801 | + _conn.setClientInfo(name, value); |
| | 1802 | + } |
| | 1803 | + catch (SQLClientInfoException e) { |
| | 1804 | + throw e; |
| | 1805 | + } |
| | 1806 | + catch (SQLException e) { |
| | 1807 | + throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e); |
| | 1808 | + } |
| | 1809 | + } |
| | 1810 | + |
| | 1811 | + public void setClientInfo(Properties properties) throws SQLClientInfoException { |
| | 1812 | + try { |
| | 1813 | + checkOpen(); |
| | 1814 | + _conn.setClientInfo(properties); |
| | 1815 | + } |
| | 1816 | + catch (SQLClientInfoException e) { |
| | 1817 | + throw e; |
| | 1818 | + } |
| | 1819 | + catch (SQLException e) { |
| | 1820 | + throw new SQLClientInfoException("Connection is closed.", EMPTY_FAILED_PROPERTIES, e); |
| | 1821 | + } |
| | 1822 | + } |
| | 1823 | + |
| | 1824 | + public Properties getClientInfo() throws SQLException { |
| | 1825 | + checkOpen(); |
| | 1826 | + try { |
| | 1827 | + return _conn.getClientInfo(); |
| | 1828 | + } |
| | 1829 | + catch (SQLException e) { |
| | 1830 | + handleException(e); |
| | 1831 | + return null; |
| | 1832 | + } |
| | 1833 | + } |
| | 1834 | + |
| | 1835 | + public String getClientInfo(String name) throws SQLException { |
| | 1836 | + checkOpen(); |
| | 1837 | + try { |
| | 1838 | + return _conn.getClientInfo(name); |
| | 1839 | + } |
| | 1840 | + catch (SQLException e) { |
| | 1841 | + handleException(e); |
| | 1842 | + return null; |
| | 1843 | + } |
| | 1844 | + } |
| | 1845 | +/* JDBC_4_ANT_KEY_END */ |
| | 1846 | } |
| | 1847 | Index: src/java/org/apache/commons/dbcp/DelegatingStatement.java |
| | 1848 | =================================================================== |
| | 1849 | --- src/java/org/apache/commons/dbcp/DelegatingStatement.java (revision 558600) |
| | 1850 | +++ src/java/org/apache/commons/dbcp/DelegatingStatement.java (working copy) |
| | 1851 | @@ -128,10 +128,6 @@ |
| | 1852 | |
| | 1853 | protected boolean _closed = false; |
| | 1854 | |
| | 1855 | - protected boolean isClosed() { |
| | 1856 | - return _closed; |
| | 1857 | - } |
| | 1858 | - |
| | 1859 | protected void checkOpen() throws SQLException { |
| | 1860 | if(isClosed()) { |
| | 1861 | throw new SQLException |
| | 1862 | @@ -346,4 +342,39 @@ |
| | 1863 | { checkOpen(); try { return _stmt.getResultSetHoldability(); } catch (SQLException e) { handleException(e); return 0; } } |
| | 1864 | |
| | 1865 | /* JDBC_3_ANT_KEY_END */ |
| | 1866 | +/* JDBC_4_ANT_KEY_BEGIN */ |
| | 1867 | + |
| | 1868 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1869 | + return _conn.isWrapperFor(iface); |
| | 1870 | + } |
| | 1871 | + |
| | 1872 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1873 | + return _conn.unwrap(iface); |
| | 1874 | + } |
| | 1875 | + |
| | 1876 | + public boolean isClosed() throws SQLException { |
| | 1877 | + return _closed; |
| | 1878 | + } |
| | 1879 | + |
| | 1880 | + public void setPoolable(boolean poolable) throws SQLException { |
| | 1881 | + checkOpen(); |
| | 1882 | + try { |
| | 1883 | + _stmt.setPoolable(poolable); |
| | 1884 | + } |
| | 1885 | + catch (SQLException e) { |
| | 1886 | + handleException(e); |
| | 1887 | + } |
| | 1888 | + } |
| | 1889 | + |
| | 1890 | + public boolean isPoolable() throws SQLException { |
| | 1891 | + checkOpen(); |
| | 1892 | + try { |
| | 1893 | + return _stmt.isPoolable(); |
| | 1894 | + } |
| | 1895 | + catch (SQLException e) { |
| | 1896 | + handleException(e); |
| | 1897 | + return false; |
| | 1898 | + } |
| | 1899 | + } |
| | 1900 | +/* JDBC_4_ANT_KEY_END */ |
| | 1901 | } |
| | 1902 | Index: src/java/org/apache/commons/dbcp/BasicDataSource.java |
| | 1903 | =================================================================== |
| | 1904 | --- src/java/org/apache/commons/dbcp/BasicDataSource.java (revision 558600) |
| | 1905 | +++ src/java/org/apache/commons/dbcp/BasicDataSource.java (working copy) |
| | 1906 | @@ -1115,7 +1115,14 @@ |
| | 1907 | } |
| | 1908 | } |
| | 1909 | |
| | 1910 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1911 | + return false; |
| | 1912 | + } |
| | 1913 | |
| | 1914 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1915 | + throw new SQLException("BasicDataSource is not a wrapper."); |
| | 1916 | + } |
| | 1917 | + |
| | 1918 | // ------------------------------------------------------ Protected Methods |
| | 1919 | |
| | 1920 | |
| | 1921 | Index: src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java |
| | 1922 | =================================================================== |
| | 1923 | --- src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java (revision 558600) |
| | 1924 | +++ src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java (working copy) |
| | 1925 | @@ -154,6 +154,14 @@ |
| | 1926 | */ |
| | 1927 | public abstract void close() throws Exception; |
| | 1928 | |
| | 1929 | + public boolean isWrapperFor(Class<?> iface) throws SQLException { |
| | 1930 | + return false; |
| | 1931 | + } |
| | 1932 | + |
| | 1933 | + public <T> T unwrap(Class<T> iface) throws SQLException { |
| | 1934 | + throw new SQLException("InstanceKeyDataSource is not a wrapper."); |
| | 1935 | + } |
| | 1936 | + |
| | 1937 | // ------------------------------------------------------------------- |
| | 1938 | // Properties |
| | 1939 | |
| | 1940 | Index: project.properties |
| | 1941 | =================================================================== |
| | 1942 | --- project.properties (revision 558600) |
| | 1943 | +++ project.properties (working copy) |
| | 1944 | @@ -30,8 +30,8 @@ |
| | 1945 | maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html |
| | 1946 | |
| | 1947 | # JDK level |
| | 1948 | -maven.compile.source=1.3 |
| | 1949 | -maven.compile.target=1.3 |
| | 1950 | +maven.compile.source=1.6 |
| | 1951 | +maven.compile.target=1.6 |
| | 1952 | |
| | 1953 | # Merge in a file containing just Built-By attribute |
| | 1954 | maven.jar.manifest=${basedir}/manifestMods.txt |