Bird
0
0

Given this application.properties snippet:

medium📝 component behavior Q13 of 15
Spring Boot - Application Configuration
Given this application.properties snippet:
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=root
spring.datasource.password=pass123

What will Spring Boot use for the database username?
Aroot
Blocalhost
Cpass123
Dmydb
Step-by-Step Solution
Solution:
  1. Step 1: Identify the key for username

    The key spring.datasource.username holds the database username.
  2. Step 2: Read the value assigned

    The value assigned is root, so Spring Boot uses this as the username.
  3. Final Answer:

    root -> Option A
  4. Quick Check:

    Username key value = root [OK]
Quick Trick: Look for .username key to find DB user [OK]
Common Mistakes:
  • Confusing URL or password as username
  • Reading the database name as username
  • Ignoring the key names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes