1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
|
diff -ur src.old/java/org/apache/commons/dbcp/BasicDataSource.java src/java/org/apache/commons/dbcp/BasicDataSource.java
--- src.old/java/org/apache/commons/dbcp/BasicDataSource.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/BasicDataSource.java 2014-03-25 13:55:40.752579143 +0000
@@ -24,10 +24,12 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Collections;
+import java.util.logging.Logger;
import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import javax.sql.DataSource;
import org.apache.commons.pool.KeyedObjectPoolFactory;
@@ -1579,4 +1581,8 @@
logWriter.println(message);
}
}
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
}
diff -ur src.old/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java
--- src.old/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java 2010-02-07 16:59:19.000000000 +0000
+++ src/java/org/apache/commons/dbcp/cpdsadapter/DriverAdapterCPDS.java 2014-03-25 15:25:25.795205555 +0000
@@ -17,22 +17,25 @@
package org.apache.commons.dbcp.cpdsadapter;
-import java.util.Hashtable;
-import java.util.Properties;
import java.io.PrintWriter;
import java.io.Serializable;
import java.sql.DriverManager;
import java.sql.SQLException;
-import javax.sql.PooledConnection;
-import javax.sql.ConnectionPoolDataSource;
-import javax.naming.Name;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.logging.Logger;
+
import javax.naming.Context;
-import javax.naming.Referenceable;
-import javax.naming.spi.ObjectFactory;
-import javax.naming.Reference;
+import javax.naming.Name;
+import javax.naming.NamingException;
import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
import javax.naming.StringRefAddr;
-import javax.naming.NamingException;
+import javax.naming.spi.ObjectFactory;
+import javax.sql.ConnectionPoolDataSource;
+import javax.sql.PooledConnection;
import org.apache.commons.pool.KeyedObjectPool;
import org.apache.commons.pool.impl.GenericKeyedObjectPool;
@@ -514,6 +517,10 @@
public PrintWriter getLogWriter() {
return logWriter;
}
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
/**
* Sets the maximum time in seconds that this data source will wait
diff -ur src.old/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java
--- src.old/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/datasources/InstanceKeyDataSource.java 2014-03-25 15:03:27.672985191 +0000
@@ -21,8 +21,10 @@
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.NoSuchElementException;
import java.util.Properties;
+import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
@@ -417,6 +419,10 @@
public void setLogWriter(PrintWriter v) {
this.logWriter = v;
}
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
/**
* @see #getTestOnBorrow
Only in src/java/org/apache/commons/dbcp/datasources: .InstanceKeyDataSource.java.swp
diff -ur src.old/java/org/apache/commons/dbcp/DelegatingCallableStatement.java src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java
--- src.old/java/org/apache/commons/dbcp/DelegatingCallableStatement.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/DelegatingCallableStatement.java 2014-03-25 14:32:12.216370435 +0000
@@ -143,6 +143,12 @@
public Object getObject(int parameterIndex) throws SQLException
{ checkOpen(); try { return ((CallableStatement)_stmt).getObject( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException
+ { checkOpen(); try { return ((CallableStatement)_stmt).getObject( parameterIndex, type); } catch (SQLException e) { handleException(e); return null; } }
+
+ public <T> T getObject(String name, Class<T> type) throws SQLException
+ { checkOpen(); try { return ((CallableStatement)_stmt).getObject( name, type); } catch (SQLException e) { handleException(e); return null; } }
+
public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
{ checkOpen(); try { return ((CallableStatement)_stmt).getBigDecimal( parameterIndex); } catch (SQLException e) { handleException(e); return null; } }
@@ -329,6 +335,7 @@
public URL getURL(String parameterName) throws SQLException
{ checkOpen(); try { return ((CallableStatement)_stmt).getURL(parameterName); } catch (SQLException e) { handleException(e); return null; } }
+
/* JDBC_4_ANT_KEY_BEGIN */
public RowId getRowId(int parameterIndex) throws SQLException {
diff -ur src.old/java/org/apache/commons/dbcp/DelegatingConnection.java src/java/org/apache/commons/dbcp/DelegatingConnection.java
--- src.old/java/org/apache/commons/dbcp/DelegatingConnection.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/DelegatingConnection.java 2014-03-25 15:25:06.381594054 +0000
@@ -27,6 +27,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Executor;
import java.sql.ResultSet;
/* JDBC_4_ANT_KEY_BEGIN */
import java.sql.Array;
@@ -538,6 +539,60 @@
}
}
+ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
+ checkOpen();
+ try {
+ _conn.setNetworkTimeout(executor, milliseconds);
+ } catch (SQLException e) {
+ handleException(e);
+ }
+ }
+
+
+ public int getNetworkTimeout() throws SQLException {
+ checkOpen();
+ try {
+ return _conn.getNetworkTimeout();
+ }
+ catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
+ public void abort(Executor executor) throws SQLException {
+ if (_conn!=null) {
+ try {
+ _conn.abort(executor);
+ } catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+ }
+
+ @Override
+ public void setSchema(String schema) throws SQLException {
+ checkOpen();
+ try {
+ _conn.setSchema(schema);
+ } catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
+ @Override
+ public String getSchema() throws SQLException {
+ checkOpen();
+ try {
+ return _conn.getSchema();
+ } catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
/* JDBC_4_ANT_KEY_BEGIN */
public boolean isWrapperFor(Class<?> iface) throws SQLException {
diff -ur src.old/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java src/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java
--- src.old/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/DelegatingDatabaseMetaData.java 2014-03-25 14:36:20.719641630 +0000
@@ -270,6 +270,23 @@
catch (SQLException e) { handleException(e); return 0; } }
}
+ public boolean generatedKeyAlwaysReturned() throws SQLException {
+ { try { return _meta.generatedKeyAlwaysReturned(); }
+ catch (SQLException e) { handleException(e); return false; } }
+ }
+
+ public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException {
+ _conn.checkOpen();
+ try {
+ return DelegatingResultSet.wrapResultSet(_conn,
+ _meta.getPseudoColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern));
+ }
+ catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
public int getDriverMajorVersion() {return _meta.getDriverMajorVersion();}
public int getDriverMinorVersion() {return _meta.getDriverMinorVersion();}
diff -ur src.old/java/org/apache/commons/dbcp/DelegatingResultSet.java src/java/org/apache/commons/dbcp/DelegatingResultSet.java
--- src.old/java/org/apache/commons/dbcp/DelegatingResultSet.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/DelegatingResultSet.java 2014-03-25 14:37:14.777029363 +0000
@@ -324,9 +324,15 @@
public Object getObject(int columnIndex) throws SQLException
{ try { return _res.getObject(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException
+ { try { return _res.getObject(columnIndex, type); } catch (SQLException e) { handleException(e); return null; } }
+
public Object getObject(String columnName) throws SQLException
{ try { return _res.getObject(columnName); } catch (SQLException e) { handleException(e); return null; } }
+ public <T> T getObject(String columnName, Class<T> type) throws SQLException
+ { try { return _res.getObject(columnName, type); } catch (SQLException e) { handleException(e); return null; } }
+
public int findColumn(String columnName) throws SQLException
{ try { return _res.findColumn(columnName); } catch (SQLException e) { handleException(e); return 0; } }
diff -ur src.old/java/org/apache/commons/dbcp/DelegatingStatement.java src/java/org/apache/commons/dbcp/DelegatingStatement.java
--- src.old/java/org/apache/commons/dbcp/DelegatingStatement.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/DelegatingStatement.java 2014-03-25 14:32:21.113152723 +0000
@@ -23,6 +23,7 @@
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.List;
+import java.util.concurrent.Executor;
/**
* A base delegating implementation of {@link Statement}.
@@ -191,6 +192,26 @@
}
}
+ public void closeOnCompletion() throws SQLException {
+ checkOpen();
+ try {
+ _stmt.closeOnCompletion();
+ } catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
+ public boolean isCloseOnCompletion() throws SQLException {
+ checkOpen();
+ try {
+ return _stmt.isCloseOnCompletion();
+ } catch (SQLException e) {
+ handleException(e);
+ throw new AssertionError();
+ }
+ }
+
protected void passivate() throws SQLException {
if(_stmt instanceof DelegatingStatement) {
((DelegatingStatement)_stmt).passivate();
diff -ur src.old/java/org/apache/commons/dbcp/PoolingDataSource.java src/java/org/apache/commons/dbcp/PoolingDataSource.java
--- src.old/java/org/apache/commons/dbcp/PoolingDataSource.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/PoolingDataSource.java 2014-03-25 15:03:08.289371317 +0000
@@ -25,8 +25,10 @@
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.Map;
import java.util.NoSuchElementException;
+import java.util.logging.Logger;
import javax.sql.DataSource;
@@ -167,6 +169,10 @@
protected ObjectPool _pool = null;
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
+
/**
* PoolGuardConnectionWrapper is a Connection wrapper that makes sure a
* closed connection cannot be used anymore.
diff -ur src.old/java/org/apache/commons/dbcp/PoolingDriver.java src/java/org/apache/commons/dbcp/PoolingDriver.java
--- src.old/java/org/apache/commons/dbcp/PoolingDriver.java 2010-02-07 16:59:20.000000000 +0000
+++ src/java/org/apache/commons/dbcp/PoolingDriver.java 2014-03-25 15:30:36.676312656 +0000
@@ -19,21 +19,13 @@
import java.io.IOException;
import java.io.InputStream;
-import java.sql.CallableStatement;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.Driver;
-import java.sql.DriverManager;
-import java.sql.DriverPropertyInfo;
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.Statement;
+import java.sql.*;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.Set;
+import java.util.logging.Logger;
import org.apache.commons.jocl.JOCLContentHandler;
import org.apache.commons.pool.ObjectPool;
@@ -239,6 +231,10 @@
return new DriverPropertyInfo[0];
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
+
/** My URL prefix */
protected static final String URL_PREFIX = "jdbc:apache:commons:dbcp:";
protected static final int URL_PREFIX_LEN = URL_PREFIX.length();
diff -ur src.old/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java src/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java
--- src.old/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/datasources/ConnectionPoolDataSourceProxy.java 2014-03-25 16:02:00.459832403 +0000
@@ -19,6 +19,9 @@
import java.io.PrintWriter;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
+
import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;
@@ -80,4 +83,9 @@
return tpc;
}
+ @Override
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ throw new SQLFeatureNotSupportedException();
+ }
+
}
diff -ur src.old/test/org/apache/commons/dbcp/TesterCallableStatement.java src/test/org/apache/commons/dbcp/TesterCallableStatement.java
--- src.old/test/org/apache/commons/dbcp/TesterCallableStatement.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterCallableStatement.java 2014-03-25 15:31:58.090805042 +0000
@@ -128,6 +128,16 @@
return null;
}
+ @Override
+ public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException {
+ return null;
+ }
+
+ @Override
+ public <T> T getObject(String parameterName, Class<T> type) throws SQLException {
+ return null;
+ }
+
public BigDecimal getBigDecimal(int parameterIndex) throws SQLException {
return null;
}
@@ -456,4 +466,14 @@
public void setNClob(String parameterName, Reader reader) throws SQLException {
}
/* JDBC_4_ANT_KEY_END */
+
+ @Override
+ public void closeOnCompletion() throws SQLException {
+
+ }
+
+ @Override
+ public boolean isCloseOnCompletion() throws SQLException {
+ return false;
+ }
}
diff -ur src.old/test/org/apache/commons/dbcp/TesterConnection.java src/test/org/apache/commons/dbcp/TesterConnection.java
--- src.old/test/org/apache/commons/dbcp/TesterConnection.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterConnection.java 2014-03-25 15:32:46.261490175 +0000
@@ -35,6 +35,7 @@
import java.sql.Struct;
import java.util.Properties;
/* JDBC_4_ANT_KEY_END */
+import java.util.concurrent.Executor;
/**
* A dummy {@link Connection}, for testing purposes.
@@ -334,4 +335,25 @@
throw new SQLException("Not implemented.");
}
/* JDBC_4_ANT_KEY_END */
+
+ public void setSchema(String schema) throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
+ public String getSchema() throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
+ public void abort(Executor executor) throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
+ public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
+ public int getNetworkTimeout() throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
}
diff -ur src.old/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java src/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java
--- src.old/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterDatabaseMetaData.java 2014-03-25 15:33:50.245748196 +0000
@@ -761,4 +761,14 @@
}
/* JDBC_4_ANT_KEY_END */
+
+ public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
+ throws SQLException {
+ return null;
+ }
+
+ @Override
+ public boolean generatedKeyAlwaysReturned() throws SQLException {
+ return false;
+ }
}
diff -ur src.old/test/org/apache/commons/dbcp/TesterDriver.java src/test/org/apache/commons/dbcp/TesterDriver.java
--- src.old/test/org/apache/commons/dbcp/TesterDriver.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterDriver.java 2014-03-25 15:34:14.306096159 +0000
@@ -22,7 +22,9 @@
import java.sql.DriverManager;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
+import java.util.logging.Logger;
/**
* Mock object implementing the <code>java.sql.Driver</code> interface.
@@ -116,6 +118,10 @@
return new DriverPropertyInfo[0];
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ return null;
+ }
+
protected static final String CONNECT_STRING = "jdbc:apache:commons:testdriver";
// version numbers
diff -ur src.old/test/org/apache/commons/dbcp/TesterResultSet.java src/test/org/apache/commons/dbcp/TesterResultSet.java
--- src.old/test/org/apache/commons/dbcp/TesterResultSet.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterResultSet.java 2014-03-25 15:45:08.482149168 +0000
@@ -305,6 +305,16 @@
return columnName;
}
+ @Override
+ public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
+ return type.cast(getObject(columnIndex));
+ }
+
+ @Override
+ public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
+ return type.cast(getObject(columnLabel));
+ }
+
public int findColumn(String columnName) throws SQLException {
checkOpen();
return 1;
diff -ur src.old/test/org/apache/commons/dbcp/TesterStatement.java src/test/org/apache/commons/dbcp/TesterStatement.java
--- src.old/test/org/apache/commons/dbcp/TesterStatement.java 2010-02-07 16:59:19.000000000 +0000
+++ src/test/org/apache/commons/dbcp/TesterStatement.java 2014-03-25 16:00:41.102044772 +0000
@@ -296,4 +296,15 @@
throw new SQLException("Not implemented.");
}
/* JDBC_4_ANT_KEY_END */
+
+ @Override
+ public void closeOnCompletion() throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
+ @Override
+ public boolean isCloseOnCompletion() throws SQLException {
+ throw new SQLException("Not implemented.");
+ }
+
}
|