Courseiva

DP-300 Implement a secure environment Practice Question

You need to ensure that all connections to an Azure SQL Database use encryption. The application uses the JDBC driver. What should you configure in the connection string?

⚠ Common exam trap

Many candidates confuse the JDBC properties with those of other drivers (like ODBC or .NET SqlClient), where 'TrustServerCertificate' or 'Encrypt' may have different default behaviors, leading them to select Option B or D incorrectly.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Add 'encrypt=true' and 'trustServerCertificate=false'

For JDBC connections to Azure SQL Database, setting 'encrypt=true' enforces TLS encryption for data in transit, and 'trustServerCertificate=false' ensures that the server's TLS certificate is validated against the trusted certificate authority (CA) chain, preventing man-in-the-middle attacks. This is the recommended configuration for secure connections to Azure SQL Database.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Add 'hostNameInCertificate=*.database.windows.net'

    Why it's wrong here

    hostNameInCertificate only tells the driver which name to match against the server certificate; it does not enable encryption. It is used when the certificate's subject differs from the host, a naming mismatch scenario, not for turning encryption on.

  • ✗

    Add 'encrypt=false' and 'trustServerCertificate=true'

    Why it's wrong here

    Setting encrypt=false disables TLS entirely, and trustServerCertificate=true only skips certificate validation, so neither enforces encryption. These flags are tempting for bypassing certificate errors during testing, but the requirement is encrypted connections, satisfied by encrypt=true with a trusted certificate.

  • ✓

    Add 'encrypt=true' and 'trustServerCertificate=false'

    Why this is correct

    Setting encrypt=true forces the JDBC driver to negotiate TLS, while trustServerCertificate=false makes it validate the server certificate chain. Together they satisfy the requirement that all connections are genuinely encrypted and authenticated, preventing silent fallback to unencrypted sessions.

  • ✗

    Add 'useEncryption=true' and 'validateServerCertificate=true'

    Why it's wrong here

    useEncryption and validateServerCertificate are not recognised Microsoft JDBC driver properties, so they are ignored and encryption is not enforced. They resemble settings from other drivers, which is why they tempt, but the Microsoft JDBC driver expects encrypt and trustServerCertificate.

About these practice questions

Courseiva writes every DP-300 question from scratch — 574 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.