@Beta public class JdbcDataLink extends DataLinkBase
DataLinkConfig.className
to type
DataLink
implementation for JDBC.
Implementation is based on HikariDataSource
. DataLinkConfig.getProperties()
are passed directly
to HikariConfig
. For available options see
HikariCP configuration
Constructor and Description |
---|
JdbcDataLink(DataLinkConfig config) |
Modifier and Type | Method and Description |
---|---|
protected com.zaxxer.hikari.HikariDataSource |
createHikariDataSource() |
void |
destroy()
Called by the member when shutting down.
|
Connection |
getConnection()
Return a
Connection based on this DataLink configuration. |
List<DataLinkResource> |
listResources()
Returns list of
DataLinkResource s accessible via this DataLink. |
getConfig, getName, release, retain
public JdbcDataLink(DataLinkConfig config)
protected com.zaxxer.hikari.HikariDataSource createHikariDataSource()
@Nonnull public List<DataLinkResource> listResources()
DataLink
DataLinkResource
s accessible via this DataLink.
It is not strictly required that the data link lists all resources; a resource can be used even if it is not listed. For example, the list of resources in Oracle database might not include tables available through a database link. In fact, it might list no resources at all, perhaps if the security in the target system prevents reading of such a list.
The returned list contains up-to-date list of resources. Any changes (added or removed resources) must be reflected in subsequent calls to this method.
public Connection getConnection()
Connection
based on this DataLink configuration.
Depending on the DataLinkConfig.isShared()
config the Connection is
- shared=true -> a new Connection is created each time the method is called
- shared=false -> a Connection is obtained from a pool, returned back to
the pool, when it is closed
The caller must close the Connection when finished to allow correct release of the underlying resources. In case of a single-use connection, the connection is closed immediately. For pooled connections the connection is returned to the pool.
public void destroy()
DataLink
Copyright © 2023 Hazelcast, Inc.. All rights reserved.