2323import java .sql .SQLException ;
2424
2525import org .apache .commons .dbcp2 .function .SQLFunction0 ;
26- import org .apache .commons .dbcp2 .function .SQLFunction1 ;
2726import org .apache .commons .dbcp2 .function .SQLFunction2 ;
2827import org .apache .commons .dbcp2 .function .SQLFunction3 ;
2928import org .apache .commons .dbcp2 .function .SQLFunction4 ;
@@ -52,11 +51,11 @@ public class DelegatingDatabaseMetaData extends ResourceFunctions implements Dat
5251 /**
5352 * Constructs a new instance for the given delegating connection and database meta data.
5453 *
55- * @param connection the delegating connection
54+ * @param connection the delegating connection
5655 * @param databaseMetaData the database meta data
5756 */
5857 public DelegatingDatabaseMetaData (final DelegatingConnection <?> connection ,
59- final DatabaseMetaData databaseMetaData ) {
58+ final DatabaseMetaData databaseMetaData ) {
6059 super ();
6160 this .connection = connection ;
6261 this .databaseMetaData = databaseMetaData ;
@@ -104,14 +103,14 @@ public boolean generatedKeyAlwaysReturned() throws SQLException {
104103
105104 @ Override
106105 public ResultSet getAttributes (final String catalog , final String schemaPattern , final String typeNamePattern ,
107- final String attributeNamePattern ) throws SQLException {
106+ final String attributeNamePattern ) throws SQLException {
108107 return toResultSet (databaseMetaData ::getAttributes , catalog , schemaPattern , typeNamePattern ,
109- attributeNamePattern );
108+ attributeNamePattern );
110109 }
111110
112111 @ Override
113112 public ResultSet getBestRowIdentifier (final String catalog , final String schema , final String table ,
114- final int scope , final boolean nullable ) throws SQLException {
113+ final int scope , final boolean nullable ) throws SQLException {
115114 return toResultSet (databaseMetaData ::getBestRowIdentifier , catalog , schema , table , scope , nullable );
116115 }
117116
@@ -137,13 +136,13 @@ public ResultSet getClientInfoProperties() throws SQLException {
137136
138137 @ Override
139138 public ResultSet getColumnPrivileges (final String catalog , final String schema , final String table ,
140- final String columnNamePattern ) throws SQLException {
139+ final String columnNamePattern ) throws SQLException {
141140 return toResultSet (databaseMetaData ::getColumnPrivileges , catalog , schema , table , columnNamePattern );
142141 }
143142
144143 @ Override
145144 public ResultSet getColumns (final String catalog , final String schemaPattern , final String tableNamePattern ,
146- final String columnNamePattern ) throws SQLException {
145+ final String columnNamePattern ) throws SQLException {
147146 return toResultSet (databaseMetaData ::getColumns , catalog , schemaPattern , tableNamePattern , columnNamePattern );
148147 }
149148
@@ -154,9 +153,9 @@ public Connection getConnection() throws SQLException {
154153
155154 @ Override
156155 public ResultSet getCrossReference (final String parentCatalog , final String parentSchema , final String parentTable ,
157- final String foreignCatalog , final String foreignSchema , final String foreignTable ) throws SQLException {
156+ final String foreignCatalog , final String foreignSchema , final String foreignTable ) throws SQLException {
158157 return toResultSet (databaseMetaData ::getCrossReference , parentCatalog , parentSchema , parentTable ,
159- foreignCatalog , foreignSchema , foreignTable );
158+ foreignCatalog , foreignSchema , foreignTable );
160159 }
161160
162161 @ Override
@@ -215,7 +214,7 @@ public String getDriverVersion() throws SQLException {
215214
216215 @ Override
217216 public ResultSet getExportedKeys (final String catalog , final String schema , final String table )
218- throws SQLException {
217+ throws SQLException {
219218 return toResultSet (databaseMetaData ::getExportedKeys , catalog , schema , table );
220219 }
221220
@@ -226,14 +225,14 @@ public String getExtraNameCharacters() throws SQLException {
226225
227226 @ Override
228227 public ResultSet getFunctionColumns (final String catalog , final String schemaPattern ,
229- final String functionNamePattern , final String columnNamePattern ) throws SQLException {
228+ final String functionNamePattern , final String columnNamePattern ) throws SQLException {
230229 return toResultSet (databaseMetaData ::getFunctionColumns , catalog , schemaPattern , functionNamePattern ,
231- columnNamePattern );
230+ columnNamePattern );
232231 }
233232
234233 @ Override
235234 public ResultSet getFunctions (final String catalog , final String schemaPattern , final String functionNamePattern )
236- throws SQLException {
235+ throws SQLException {
237236 return toResultSet (databaseMetaData ::getFunctions , catalog , schemaPattern , functionNamePattern );
238237 }
239238
@@ -244,13 +243,13 @@ public String getIdentifierQuoteString() throws SQLException {
244243
245244 @ Override
246245 public ResultSet getImportedKeys (final String catalog , final String schema , final String table )
247- throws SQLException {
246+ throws SQLException {
248247 return toResultSet (databaseMetaData ::getImportedKeys , catalog , schema , table );
249248 }
250249
251250 @ Override
252251 public ResultSet getIndexInfo (final String catalog , final String schema , final String table , final boolean unique ,
253- final boolean approximate ) throws SQLException {
252+ final boolean approximate ) throws SQLException {
254253 return toResultSet (databaseMetaData ::getIndexInfo , catalog , schema , table , unique , approximate );
255254 }
256255
@@ -409,14 +408,14 @@ public ResultSet getPrimaryKeys(final String catalog, final String schema, final
409408
410409 @ Override
411410 public ResultSet getProcedureColumns (final String catalog , final String schemaPattern ,
412- final String procedureNamePattern , final String columnNamePattern ) throws SQLException {
411+ final String procedureNamePattern , final String columnNamePattern ) throws SQLException {
413412 return toResultSet (databaseMetaData ::getProcedureColumns , catalog , schemaPattern , procedureNamePattern ,
414- columnNamePattern );
413+ columnNamePattern );
415414 }
416415
417416 @ Override
418417 public ResultSet getProcedures (final String catalog , final String schemaPattern , final String procedureNamePattern )
419- throws SQLException {
418+ throws SQLException {
420419 return toResultSet (databaseMetaData ::getProcedures , catalog , schemaPattern , procedureNamePattern );
421420 }
422421
@@ -427,9 +426,9 @@ public String getProcedureTerm() throws SQLException {
427426
428427 @ Override
429428 public ResultSet getPseudoColumns (final String catalog , final String schemaPattern , final String tableNamePattern ,
430- final String columnNamePattern ) throws SQLException {
429+ final String columnNamePattern ) throws SQLException {
431430 return toResultSet (databaseMetaData ::getPseudoColumns , catalog , schemaPattern , tableNamePattern ,
432- columnNamePattern );
431+ columnNamePattern );
433432 }
434433
435434 @ Override
@@ -479,14 +478,14 @@ public String getStringFunctions() throws SQLException {
479478
480479 @ Override
481480 public ResultSet getSuperTables (final String catalog , final String schemaPattern , final String tableNamePattern )
482- throws SQLException {
483- return toResultSet (databaseMetaData ::getSuperTables ,catalog , schemaPattern , tableNamePattern );
481+ throws SQLException {
482+ return toResultSet (databaseMetaData ::getSuperTables , catalog , schemaPattern , tableNamePattern );
484483 }
485484
486485 @ Override
487486 public ResultSet getSuperTypes (final String catalog , final String schemaPattern , final String typeNamePattern )
488- throws SQLException {
489- return toResultSet (databaseMetaData ::getSuperTypes ,catalog , schemaPattern , typeNamePattern );
487+ throws SQLException {
488+ return toResultSet (databaseMetaData ::getSuperTypes , catalog , schemaPattern , typeNamePattern );
490489 }
491490
492491 @ Override
@@ -496,14 +495,14 @@ public String getSystemFunctions() throws SQLException {
496495
497496 @ Override
498497 public ResultSet getTablePrivileges (final String catalog , final String schemaPattern , final String tableNamePattern )
499- throws SQLException {
500- return toResultSet (databaseMetaData ::getTablePrivileges ,catalog , schemaPattern , tableNamePattern );
498+ throws SQLException {
499+ return toResultSet (databaseMetaData ::getTablePrivileges , catalog , schemaPattern , tableNamePattern );
501500 }
502501
503502 @ Override
504503 public ResultSet getTables (final String catalog , final String schemaPattern , final String tableNamePattern ,
505- final String [] types ) throws SQLException {
506- return toResultSet (databaseMetaData ::getTables ,catalog , schemaPattern , tableNamePattern , types );
504+ final String [] types ) throws SQLException {
505+ return toResultSet (databaseMetaData ::getTables , catalog , schemaPattern , tableNamePattern , types );
507506 }
508507
509508 @ Override
@@ -523,8 +522,8 @@ public ResultSet getTypeInfo() throws SQLException {
523522
524523 @ Override
525524 public ResultSet getUDTs (final String catalog , final String schemaPattern , final String typeNamePattern ,
526- final int [] types ) throws SQLException {
527- return toResultSet (databaseMetaData ::getUDTs ,catalog , schemaPattern , typeNamePattern , types );
525+ final int [] types ) throws SQLException {
526+ return toResultSet (databaseMetaData ::getUDTs , catalog , schemaPattern , typeNamePattern , types );
528527 }
529528
530529 @ Override
@@ -539,8 +538,8 @@ public String getUserName() throws SQLException {
539538
540539 @ Override
541540 public ResultSet getVersionColumns (final String catalog , final String schema , final String table )
542- throws SQLException {
543- return toResultSet (databaseMetaData ::getVersionColumns ,catalog , schema , table );
541+ throws SQLException {
542+ return toResultSet (databaseMetaData ::getVersionColumns , catalog , schema , table );
544543 }
545544
546545 @ Override
@@ -1018,39 +1017,32 @@ private ResultSet toResultSet(final SQLFunction0<ResultSet> callableResultSet) t
10181017 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply ()));
10191018 }
10201019
1021- private <T > ResultSet toResultSet (final SQLFunction1 <T , ResultSet > callableResultSet , final T t )
1022- throws SQLException {
1023- connection .checkOpen ();
1024- return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t )));
1025- }
1026-
10271020 private <T , U > ResultSet toResultSet (final SQLFunction2 <T , U , ResultSet > callableResultSet , final T t , final U u )
1028- throws SQLException {
1021+ throws SQLException {
10291022 connection .checkOpen ();
10301023 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t , u )));
10311024 }
10321025
10331026 private <T , U , V > ResultSet toResultSet (final SQLFunction3 <T , U , V , ResultSet > callableResultSet , final T t ,
1034- final U u , final V v ) throws SQLException {
1027+ final U u , final V v ) throws SQLException {
10351028 connection .checkOpen ();
10361029 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t , u , v )));
10371030 }
10381031
10391032 private <T , U , V , X > ResultSet toResultSet (final SQLFunction4 <T , U , V , X , ResultSet > callableResultSet , final T t ,
1040- final U u , final V v , final X x ) throws SQLException {
1033+ final U u , final V v , final X x ) throws SQLException {
10411034 connection .checkOpen ();
10421035 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t , u , v , x )));
10431036 }
10441037
10451038 private <T , U , V , X , Y > ResultSet toResultSet (final SQLFunction5 <T , U , V , X , Y , ResultSet > callableResultSet ,
1046- final T t , final U u , final V v , final X x , final Y y ) throws SQLException {
1039+ final T t , final U u , final V v , final X x , final Y y ) throws SQLException {
10471040 connection .checkOpen ();
10481041 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t , u , v , x , y )));
10491042 }
10501043
1051- private <T , U , V , X , Y , Z > ResultSet toResultSet (
1052- final SQLFunction6 <T , U , V , X , Y , Z , ResultSet > callableResultSet , final T t , final U u , final V v ,
1053- final X x , final Y y , final Z z ) throws SQLException {
1044+ private <T , U , V , X , Y , Z > ResultSet toResultSet (final SQLFunction6 <T , U , V , X , Y , Z , ResultSet > callableResultSet ,
1045+ final T t , final U u , final V v , final X x , final Y y , final Z z ) throws SQLException {
10541046 connection .checkOpen ();
10551047 return apply (() -> DelegatingResultSet .wrapResultSet (connection , callableResultSet .apply (t , u , v , x , y , z )));
10561048 }
0 commit comments