Package org.springframework.boot.r2dbc
Class ConnectionFactoryBuilder
java.lang.Object
org.springframework.boot.r2dbc.ConnectionFactoryBuilder
Builder for 
ConnectionFactory.- Since:
- 2.5.0
- Author:
- Mark Paluch, Tadaya Tsuyukubo, Stephane Nicoll, Andy Wilkinson
- 
Method SummaryModifier and TypeMethodDescriptionio.r2dbc.spi.ConnectionFactorybuild()Build aConnectionFactorybased on the state of this builder.io.r2dbc.spi.ConnectionFactoryOptionsBuild aConnectionFactoryOptionsbased on the state of this builder.Configure additional options.Configure the database.static ConnectionFactoryBuilderderivedFrom(io.r2dbc.spi.ConnectionFactory connectionFactory) Initialize a newConnectionFactoryBuilderderived from the options of the specifiedconnectionFactory.Configure the host name.password(CharSequence password) Configure the password.port(int port) Configure the port.Configure the username.static ConnectionFactoryBuilderwithOptions(io.r2dbc.spi.ConnectionFactoryOptions.Builder options) Initialize a newConnectionFactoryBuilderbased on the specifiedoptions.static ConnectionFactoryBuilderInitialize a newConnectionFactoryBuilderbased on the specified R2DBC url.
- 
Method Details- 
withUrlInitialize a newConnectionFactoryBuilderbased on the specified R2DBC url.- Parameters:
- url- the url to use
- Returns:
- a new builder initialized with the options exposed in the specified url
- See Also:
 
- 
withOptionspublic static ConnectionFactoryBuilder withOptions(io.r2dbc.spi.ConnectionFactoryOptions.Builder options) Initialize a newConnectionFactoryBuilderbased on the specifiedoptions.- Parameters:
- options- the options to use to initialize the builder
- Returns:
- a new builder initialized with the settings defined in the given
 options
 
- 
derivedFrompublic static ConnectionFactoryBuilder derivedFrom(io.r2dbc.spi.ConnectionFactory connectionFactory) Initialize a newConnectionFactoryBuilderderived from the options of the specifiedconnectionFactory.- Parameters:
- connectionFactory- the connection factory whose options are to be used to initialize the builder
- Returns:
- a new builder initialized with the options from the connection factory
- Since:
- 2.5.1
 
- 
configurepublic ConnectionFactoryBuilder configure(Consumer<io.r2dbc.spi.ConnectionFactoryOptions.Builder> options) Configure additional options.- Parameters:
- options- a- Consumerto customize the options
- Returns:
- this for method chaining
 
- 
usernameConfigure the username.- Parameters:
- username- the connection factory username
- Returns:
- this for method chaining
 
- 
passwordConfigure the password.- Parameters:
- password- the connection factory password
- Returns:
- this for method chaining
 
- 
hostnameConfigure the host name.- Parameters:
- host- the connection factory hostname
- Returns:
- this for method chaining
 
- 
portConfigure the port.- Parameters:
- port- the connection factory port
- Returns:
- this for method chaining
 
- 
databaseConfigure the database.- Parameters:
- database- the connection factory database
- Returns:
- this for method chaining
 
- 
buildpublic io.r2dbc.spi.ConnectionFactory build()Build aConnectionFactorybased on the state of this builder.- Returns:
- a connection factory
 
- 
buildOptionspublic io.r2dbc.spi.ConnectionFactoryOptions buildOptions()Build aConnectionFactoryOptionsbased on the state of this builder.- Returns:
- the options
 
 
-