public List < String > getValuesOfColumn ( final int columnNumber , final String sqlQuery ) throws SQLException { LOG . info ( "Connecting to: " + this . dbString + " with " + this . usr + " and " + this . pwd ) ; LOG . info ( "Executing: " + sqlQuery ) ; List < String > result = new ArrayList < String > ( ) ; List < List < String > > allResults = this . doSelect ( sqlQuery ) ; for ( List < String > list : allResults ) { result . add ( list . get ( columnNumber ) ) ; } LOG . info ( "Result returned after running " + sqlQuery + " is: " + result ) ; return result ; }
Returns all the values corresponding to a specific column returned by executing the supplied sql .