public < V > List < V > executeScalarList ( Class < V > returnType ) { try ( ResultSet rs = executeQuery ( ) ) { List < V > values = new ArrayList <> ( ) ; while ( rs . next ( ) ) { values . add ( getScalarFromResultSet ( rs , returnType ) ) ; } return values ; } catch ( SQLException ex ) { throw new ApplicationException ( Code . BACKEND_ERROR , ex ) ; } }
Execute the PreparedStatement and return a List of primitive values from the ResultSet .