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
-
Constructor Summary
ConstructorsConstructorDescriptionJdbcUrlBuilder(String driverProtocol, int containerPort) Create a newJdbcUrlBuilderinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendParameters(StringBuilder url, String parameters) Appends to the givenurlthe givenparameters.build(RunningService service) Build a JDBC URL for the givenRunningService.build(RunningService service, String database) Build a JDBC URL for the givenRunningServiceand database.
-
Constructor Details
-
JdbcUrlBuilder
Create a newJdbcUrlBuilderinstance.- 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 givenRunningServiceand database.- Parameters:
service- the running servicedatabase- the database to connect to- Returns:
- a new JDBC URL
-
appendParameters
Appends to the givenurlthe givenparameters.The default implementation appends a
?followed by theparameters.- Parameters:
url- the urlparameters- the parameters- Since:
- 3.2.7
-