java.lang.Object
io.helidon.dbclient.jdbc.JdbcDbClientProviderBuilder
- All Implemented Interfaces:
Builder<JdbcDbClientProviderBuilder,
,DbClient> DbClientProviderBuilder<JdbcDbClientProviderBuilder>
,Supplier<DbClient>
public final class JdbcDbClientProviderBuilder
extends Object
implements DbClientProviderBuilder<JdbcDbClientProviderBuilder>
Fluent API builder for
JdbcDbClientProviderBuilder
that implements
the DbClientProviderBuilder
from Helidon DB API.-
Method Summary
Modifier and TypeMethodDescription<TYPE> JdbcDbClientProviderBuilder
addMapper
(DbMapper<TYPE> dbMapper, GenericType<TYPE> mappedType) Add a custom mapper with generic types support.<TYPE> JdbcDbClientProviderBuilder
Add a custom mapper.addMapperProvider
(DbMapperProvider provider) Database schema mappers provider.addService
(DbClientService clientService) Add an interceptor.build()
Build database handler for specific provider.Use database connection configuration from configuration file.connectionPool
(ConnectionPool connectionPool) Configure a connection pool.static JdbcDbClientProviderBuilder
create()
Create a new fluent API builder for JDBC specific db client builder.executorService
(Supplier<ExecutorService> executorServiceSupplier) Configure an explicit executor service supplier.mapperManager
(MapperManager manager) Mapper manager for generic mapping, such as mapping of parameters to expected types.Set database connection p¨assword.statements
(DbStatements statements) Statements to use either from configuration or manually configured.Set database connection string (URL).Set database connection user name.
-
Method Details
-
create
Create a new fluent API builder for JDBC specific db client builder.- Returns:
- a new instance of the builder
-
build
Description copied from interface:DbClientProviderBuilder
Build database handler for specific provider.- Specified by:
build
in interfaceBuilder<JdbcDbClientProviderBuilder,
DbClient> - Specified by:
build
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Returns:
- database handler instance
-
config
Description copied from interface:DbClientProviderBuilder
Use database connection configuration from configuration file.- Specified by:
config
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
config
-Config
instance with database connection attributes- Returns:
- database provider builder
-
connectionPool
Configure a connection pool.- Parameters:
connectionPool
- connection pool to get connections to a database- Returns:
- updated builder instance
-
executorService
public JdbcDbClientProviderBuilder executorService(Supplier<ExecutorService> executorServiceSupplier) Configure an explicit executor service supplier. The executor service is used to execute blocking calls to a database.- Parameters:
executorServiceSupplier
- supplier to obtain an executor service from- Returns:
- updated builder instance
-
url
Description copied from interface:DbClientProviderBuilder
Set database connection string (URL).- Specified by:
url
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
url
- database connection string- Returns:
- database provider builder
-
username
Description copied from interface:DbClientProviderBuilder
Set database connection user name.- Specified by:
username
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
username
- database connection user name- Returns:
- database provider builder
-
password
Description copied from interface:DbClientProviderBuilder
Set database connection p¨assword.- Specified by:
password
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
password
- database connection password- Returns:
- database provider builder
-
statements
Description copied from interface:DbClientProviderBuilder
Statements to use either from configuration or manually configured.- Specified by:
statements
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
statements
- Statements to use- Returns:
- updated builder instance
-
addMapper
public <TYPE> JdbcDbClientProviderBuilder addMapper(DbMapper<TYPE> dbMapper, Class<TYPE> mappedClass) Description copied from interface:DbClientProviderBuilder
Add a custom mapper.- Specified by:
addMapper
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedClass
- class that this mapper supports- Returns:
- updated builder instance.
-
addMapper
public <TYPE> JdbcDbClientProviderBuilder addMapper(DbMapper<TYPE> dbMapper, GenericType<TYPE> mappedType) Description copied from interface:DbClientProviderBuilder
Add a custom mapper with generic types support.- Specified by:
addMapper
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Type Parameters:
TYPE
- type of the supported class- Parameters:
dbMapper
- the mapper capable of mapping the mappedClass to various database objectsmappedType
- type that this mapper supports- Returns:
- updated builder instance.
-
mapperManager
Description copied from interface:DbClientProviderBuilder
Mapper manager for generic mapping, such as mapping of parameters to expected types.- Specified by:
mapperManager
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
manager
- mapper manager- Returns:
- updated builder instance
-
addMapperProvider
Description copied from interface:DbClientProviderBuilder
Database schema mappers provider.- Specified by:
addMapperProvider
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
provider
- database schema mappers provider to use- Returns:
- updated builder instance
-
addService
Description copied from interface:DbClientProviderBuilder
Add an interceptor. This allows to add implementation of tracing, metrics, logging etc. without the need to hard-code these into the base.- Specified by:
addService
in interfaceDbClientProviderBuilder<JdbcDbClientProviderBuilder>
- Parameters:
clientService
- interceptor instance- Returns:
- updated builder instance
-