exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 16 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 16
Topic #: 1
[All 2V0-72.22 Questions]

Refer to the exhibit.

The above code shows a conditional @Bean method for the creation of a JdbcTemplate bean.
Which two statements correctly describe the code behavior? (Choose two.)

  • A. @ConditionalOnBean(name= “dataSource”) should be replaced with @ConditionalOnBean (DataSource.class) for greater flexibility.
  • B. @ConditionalOnBean(name= “dataSource”) should be replaced with @ConditionalOnMissingBean (DataSource.class) for greater flexibility.
  • C. The @Bean annotation should be removed.
  • D. A JdbcTemplate bean will be created when the DataSource class is in the classpath but there is no DataSource bean.
  • E. A JdbcTemplate bean will be created when a bean named dataSource has already been created.
Show Suggested Answer Hide Answer
Suggested Answer: AE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
rhuanca
Highly Voted 10 months, 2 weeks ago
A and E Option D is incorrect because the @ConditionalOnBean annotation requires that a bean with the specified name or class already exists in the application context for the JdbcTemplate bean to be created.
upvoted 5 times
...
Eymet
Most Recent 3 months, 3 weeks ago
Selected Answer: AE
Answer is AE
upvoted 4 times
...
qqoo
6 months, 4 weeks ago
Selected Answer: AE
Answer is AE
upvoted 4 times
...
zakupower
11 months ago
Selected Answer: AE
These are correct
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago