protected final ResultSet executePreparedQuery ( String sql , List < Object > params ) throws SQLException { AbstractQueryCommand command = createPreparedQueryCommand ( sql , params ) ; ResultSet rs = null ; try { rs = command . execute ( ) ; } finally { command . closeResources ( ) ; } return rs ; }
Useful helper method which handles resource management when executing a prepared query which returns a result set . Derived classes of Sql can override createPreparedQueryCommand and then call this method to access the ResultSet returned from the provided query .