Class JdbcUrlBuilder
java.lang.Object
org.springframework.boot.docker.compose.service.connection.jdbc.JdbcUrlBuilder
Utility used to build a JDBC URL for a
RunningService
.- Since:
- 3.1.0
- Author:
- Moritz Halbritter, Andy Wilkinson, Phillip Webb
-
Constructor Summary
ConstructorDescriptionJdbcUrlBuilder
(String driverProtocol, int containerPort) Create a newJdbcUrlBuilder
instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendParameters
(StringBuilder url, String parameters) Appends to the givenurl
the givenparameters
.build
(RunningService service) Build a JDBC URL for the givenRunningService
.build
(RunningService service, String database) Build a JDBC URL for the givenRunningService
and database.
-
Constructor Details
-
JdbcUrlBuilder
Create a newJdbcUrlBuilder
instance.- Parameters:
driverProtocol
- the driver protocolcontainerPort
- the source container port
-
-
Method Details
-
build
Build a JDBC URL for the givenRunningService
.- Parameters:
service
- the running service- Returns:
- a new JDBC URL
-
build
Build a JDBC URL for the givenRunningService
and database.- Parameters:
service
- the running servicedatabase
- the database to connect to- Returns:
- a new JDBC URL
-
appendParameters
Appends to the givenurl
the givenparameters
.The default implementation appends a
?
followed by theparameters
.- Parameters:
url
- the urlparameters
- the parameters- Since:
- 3.2.7
-