类 ConnectionFactoryBuilder
java.lang.Object
org.springframework.boot.r2dbc.ConnectionFactoryBuilder
Builder for
ConnectionFactory
.- 从以下版本开始:
- 2.5.0
- 作者:
- Mark Paluch, Tadaya Tsuyukubo, Stephane Nicoll, Andy Wilkinson, Moritz Halbritter
-
方法概要
修饰符和类型方法说明io.r2dbc.spi.ConnectionFactory
build()
Build aConnectionFactory
based on the state of this builder.io.r2dbc.spi.ConnectionFactoryOptions
Build aConnectionFactoryOptions
based on the state of this builder.Configure additional options.Configure the database.decorator
(ConnectionFactoryDecorator decorator) Add adecorator
.decorators
(Iterable<ConnectionFactoryDecorator> decorators) Adddecorators
.static ConnectionFactoryBuilder
derivedFrom
(io.r2dbc.spi.ConnectionFactory connectionFactory) Initialize a newConnectionFactoryBuilder
derived 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 ConnectionFactoryBuilder
withOptions
(io.r2dbc.spi.ConnectionFactoryOptions.Builder options) Initialize a newConnectionFactoryBuilder
based on the specifiedoptions
.static ConnectionFactoryBuilder
Initialize a newConnectionFactoryBuilder
based on the specified R2DBC url.
-
方法详细资料
-
withUrl
Initialize a newConnectionFactoryBuilder
based on the specified R2DBC url.- 参数:
url
- the url to use- 返回:
- a new builder initialized with the options exposed in the specified url
- 另请参阅:
-
withOptions
public static ConnectionFactoryBuilder withOptions(io.r2dbc.spi.ConnectionFactoryOptions.Builder options) Initialize a newConnectionFactoryBuilder
based on the specifiedoptions
.- 参数:
options
- the options to use to initialize the builder- 返回:
- a new builder initialized with the settings defined in the given
options
-
derivedFrom
public static ConnectionFactoryBuilder derivedFrom(io.r2dbc.spi.ConnectionFactory connectionFactory) Initialize a newConnectionFactoryBuilder
derived from the options of the specifiedconnectionFactory
.- 参数:
connectionFactory
- the connection factory whose options are to be used to initialize the builder- 返回:
- a new builder initialized with the options from the connection factory
- 从以下版本开始:
- 2.5.1
-
configure
public ConnectionFactoryBuilder configure(Consumer<io.r2dbc.spi.ConnectionFactoryOptions.Builder> options) Configure additional options.- 参数:
options
- aConsumer
to customize the options- 返回:
- this for method chaining
-
username
Configure the username.- 参数:
username
- the connection factory username- 返回:
- this for method chaining
-
password
Configure the password.- 参数:
password
- the connection factory password- 返回:
- this for method chaining
-
hostname
Configure the host name.- 参数:
host
- the connection factory hostname- 返回:
- this for method chaining
-
port
Configure the port.- 参数:
port
- the connection factory port- 返回:
- this for method chaining
-
database
Configure the database.- 参数:
database
- the connection factory database- 返回:
- this for method chaining
-
decorator
Add adecorator
.- 参数:
decorator
- the decorator to add- 返回:
- this for method chaining
- 从以下版本开始:
- 3.2.0
-
decorators
Adddecorators
.- 参数:
decorators
- the decorators to add- 返回:
- this for method chaining
- 从以下版本开始:
- 3.2.0
-
build
public io.r2dbc.spi.ConnectionFactory build()Build aConnectionFactory
based on the state of this builder.- 返回:
- a connection factory
-
buildOptions
public io.r2dbc.spi.ConnectionFactoryOptions buildOptions()Build aConnectionFactoryOptions
based on the state of this builder.- 返回:
- the options
-