public class DataSourceConnectionProvider extends java.lang.Object implements ConnectionProvider
ConnectionProvider interface. It creates and
returns an instance of PgConnection.| Constructor and Description |
|---|
DataSourceConnectionProvider(@NonNull javax.sql.DataSource dataSource,
@Nullable java.lang.String serverPropertyName,
@Nullable java.lang.String portPropertyName,
@Nullable java.lang.String urlPropertyName,
@Nullable java.lang.String databasePropertyName) |
| Modifier and Type | Method and Description |
|---|---|
java.sql.Connection |
connect(@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props)
Called once per connection that needs to be created.
|
java.sql.Connection |
connect(@NonNull java.lang.String url,
@NonNull java.util.Properties props)
Called once per connection that needs to be created.
|
public DataSourceConnectionProvider(@NonNull javax.sql.DataSource dataSource,
@Nullable java.lang.String serverPropertyName,
@Nullable java.lang.String portPropertyName,
@Nullable java.lang.String urlPropertyName,
@Nullable java.lang.String databasePropertyName)
public java.sql.Connection connect(@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props)
throws java.sql.SQLException
connect in interface ConnectionProviderprotocol - The connection protocol (example "jdbc:mysql://")hostSpec - The HostSpec containing the host-port information for the host to connect toprops - The Properties to use for the connectionConnection resulting from the given connection informationjava.sql.SQLException - if an error occurspublic java.sql.Connection connect(@NonNull java.lang.String url,
@NonNull java.util.Properties props)
throws java.sql.SQLException
connect in interface ConnectionProviderurl - The connection URLprops - The Properties to use for the connectionConnection resulting from the given connection informationjava.sql.SQLException - if an error occurs