@Override @SuppressWarnings( {"UnnecessaryBoxing"}) public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return Integer.valueOf( findColumn( ( String ) args[0] ) ); } if ( isFirstArgColumnLabel( method, args ) ) { try { int columnIndex = findColumn( ( String ) args[0] ); return invokeMethod( locateCorrespondingColumnIndexMethod( method ), buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { StringBuffer buf = new StringBuffer() .append( "Exception getting column index for column: [" ) .append( args[0] ) .append( "].\nReverting to using: [" ) .append( args[0] ) .append( "] as first argument for method: [" ) .append( method ) .append( "]" ); sqlExceptionHelper.logExceptions( ex, buf.toString() ); } catch ( NoSuchMethodException ex ) { LOG.unableToSwitchToMethodUsingColumnIndex( method ); } } return invokeMethod( method, args ); }
@Override @SuppressWarnings( {"UnnecessaryBoxing"}) public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ( "findColumn".equals( method.getName() ) ) { return Integer.valueOf( findColumn( ( String ) args[0] ) ); } if ( isFirstArgColumnLabel( method, args ) ) { try { int columnIndex = findColumn( ( String ) args[0] ); return invokeMethod( locateCorrespondingColumnIndexMethod( method ), buildColumnIndexMethodArgs( args, columnIndex ) ); } catch ( SQLException ex ) { StringBuffer buf = new StringBuffer() .append( "Exception getting column index for column: [" ) .append( args[0] ) .append( "].\nReverting to using: [" ) .append( args[0] ) .append( "] as first argument for method: [" ) .append( method ) .append( "]" ); sqlExceptionHelper.logExceptions( ex, buf.toString() ); } catch ( NoSuchMethodException ex ) { LOG.unableToSwitchToMethodUsingColumnIndex( method ); } } return invokeMethod( method, args ); }