You are developing a new application on a VM that is on your corporate network. The application will use Java Database Connectivity (JDBC) to connect to Cloud SQL for PostgreSQL. Your Cloud SQL instance is con gured with IP address 192.168.3.48, and SSL is disabled. You want to ensure that your application can access your database instance without requiring con guration changes to your database. What should you do?
Show Answer & Explanation
Correct Answer: B. Define a connection string using a database username and password to point to the internal (private) IP address of your Cloud SQL instance.
The Cloud SQL instance has IP 192.168.3.48, which is a private RFC 1918 address — this confirms it's a private/internal IP, meaning it's accessible directly from within a corporate network via VPC peering or private services access. Since SSL is disabled and the app is on the same corporate network, a direct JDBC connection using a database username and password to the private IP is the simplest and most appropriate solution — no extra tooling needed. Option B is correct because the private IP is already reachable from the corporate VM, SSL is off, and using a standard DB username/password satisfies JDBC requirements with zero database configuration changes. Option A is wrong because Google account credentials (IAM) are not standard JDBC database credentials, and using a public IP introduces unnecessary exposure and may require authorized network configuration changes. Option C is wrong because the Cloud SQL Auth Proxy listens on localhost (127.0.0.1), not on the instance's private IP — so you wouldn't point JDBC to the private IP when using the proxy. Also, the proxy adds complexity not needed here. Option D is wrong for the same proxy reason as C, plus it uses the public IP unnecessarily when private IP is already available.