- All Superinterfaces:
NamedService,NamedService
- All Known Subinterfaces:
CloseableJdbcConnectionPool
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
JDBC connection pool.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classJdbcConnectionPool.BuilderBase<B extends JdbcConnectionPool.BuilderBase<B,T>, T extends JdbcConnectionPool> Base fluent API builder forJdbcConnectionPool. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturn a connection from the pool.static JdbcConnectionPoolDeprecated, for removal: This API element is subject to removal in a future version.static JdbcConnectionPoolCreate a JDBC connection pool from provided configuration.default StringdbType()The type of this database.default Stringname()Name of this implementation, as provided inConfiguredProvider.create(io.helidon.common.config.Config, String).default Stringtype()Type of this implementation, to distinguish instances of same type, with differentNamedService.name().
-
Field Details
-
DEFAULT_DB_TYPE
Default JDBC connection pooldbType()value.- See Also:
-
-
Method Details
-
create
Deprecated, for removal: This API element is subject to removal in a future version.create(io.helidon.config.Config)insteadCreate a JDBC connection pool from provided configuration.- Parameters:
config- configuration of connection pool- Returns:
- a new instance configured from the provided config
-
create
Create a JDBC connection pool from provided configuration.Optional configuration parameters key default value description url JDBC URL of the database - this property is required when only configuration is used. Example: jdbc:mysql://127.0.0.1:3306/pokemon?useSSL=falseusername Username used to connect to the database password Password used to connect to the database - Parameters:
config- configuration of connection pool- Returns:
- a new instance configured from the provided config
-
connection
Connection connection()Return a connection from the pool. The call toConnection.close()should return that connection to the pool. The connection pool should handle capacity issues and timeouts using unchecked exceptions thrown by this method.- Returns:
- a connection read to execute statements
-
dbType
The type of this database. This could be"jdbc:mysql", etc. Default value is just"jdbc"but implementing class should set something more specific.- Returns:
- type of this database
-
name
Description copied from interface:NamedServiceName of this implementation, as provided inConfiguredProvider.create(io.helidon.common.config.Config, String).- Specified by:
namein interfaceNamedService- Specified by:
namein interfaceNamedService- Returns:
- name of this service
-
type
Description copied from interface:NamedServiceType of this implementation, to distinguish instances of same type, with differentNamedService.name(). Use for exampleConfiguredProvider.configKey()to define the type.- Specified by:
typein interfaceNamedService- Specified by:
typein interfaceNamedService- Returns:
- type of this service
-
create(io.helidon.config.Config)instead