Exam 2v0-7222 All QuestionsBrowse all questions from this exam
Question 34

Which three types of objects can be returned form a JdbcTemplate query? (Choose three.)

    Correct Answer: A, B, D

    The JdbcTemplate query method can return various types of objects based on the type of result expected and the RowMapper implemented. It typically returns simpler types like integers, longs, and strings, which are essentially simple types. It can also return user-defined types when appropriate RowMappers are provided, allowing custom objects mapping from database rows. Similarly, Generic Maps (Map<String, Object>) are often returned for ad-hoc queries needing a key-value pair representation of the result set.

Discussion
3cef6cdOptions: ABD

GenericMaps, SimpleObjects and User Defined Types are returned.

rhuanca

why not A instead of E. Generic Maps are more common query than properties in JdbcTemplate.

AzuniOptions: ABD

Generic Maps (Map<String, Object>) is one of the return types of the JdbcTemplate. To return Properties, you need to create a custom RowMapper to map the ResultSet to a Property. It doesn't support it by default.

Azuni

I went tough the official VMWare course work and they state exactly that GenericMaps, SimpleObjects and User Defined Types are returned.