in core/src/main/java/com/google/cloud/sql/core/InternalConnectorRegistry.java [168:183]
public Socket connect(ConnectionConfig config) throws IOException, InterruptedException {
if (config.getNamedConnector() != null) {
Connector connector = getNamedConnector(config.getNamedConnector());
return connector.connect(config.withConnectorConfig(connector.getConfig()), connectTimeoutMs);
}
// Validate parameters
Preconditions.checkArgument(
config.getCloudSqlInstance() != null || config.getDomainName() != null,
"cloudSqlInstance property or hostname was not set. Please specify"
+ " either cloudSqlInstance or the database hostname in the JDBC URL or the "
+ "connection Properties. cloudSqlInstance should contain a value in "
+ "form \"project:region:instance\"");
return getConnector(config).connect(config, connectTimeoutMs);
}