public class GenericTargetDriverDialect extends java.lang.Object implements TargetDriverDialect
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
ALLOWED_ON_CLOSED_METHODS |
static java.util.Set<java.lang.String> |
NETWORK_BOUND_METHODS_FOR_ENTIRE_RESULTSET |
| Constructor and Description |
|---|
GenericTargetDriverDialect() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortConnection(@NonNull java.sql.Connection connectionToAbort,
@NonNull java.util.concurrent.Executor abortExecutor) |
protected @Nullable java.lang.String |
findSQLQueryString(java.sql.PreparedStatement ps,
@Nullable java.lang.String queryHeader) |
java.util.Set<java.lang.String> |
getAllowedOnConnectionMethodNames() |
byte[] |
getEncryptedBytes(@NonNull java.sql.ResultSet rs,
java.lang.Object columnRef) |
java.util.Set<java.lang.String> |
getNetworkBoundMethodNames(@Nullable java.util.Properties properties) |
@Nullable java.lang.String |
getSQLQueryString(java.sql.PreparedStatement ps) |
java.lang.String |
getSQLState(java.lang.Throwable throwable) |
boolean |
isDialect(java.sql.Driver driver) |
boolean |
isDialect(java.lang.String dataSourceClass) |
boolean |
isDriverRegistered() |
boolean |
ping(@NonNull java.sql.Connection connection)
Attempts to communicate to a database node in order to measure network latency.
|
ConnectInfo |
prepareConnectInfo(@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props) |
void |
prepareDataSource(@NonNull javax.sql.DataSource dataSource,
@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props) |
void |
registerDataType(@NonNull java.sql.Connection connection,
@NonNull java.lang.String typeName,
@NonNull java.lang.String className) |
void |
registerDriver() |
void |
setEncryptedParameter(@NonNull java.sql.PreparedStatement ps,
int paramIndex,
byte[] encrypted) |
void |
updateInternalState(@NonNull PluginService pluginService,
@NonNull java.util.Properties props)
Allows each target driver dialect to perform last-minute adjustments to the wrapper's
internal state after the initial connection is established.
|
public static final java.util.Set<java.lang.String> ALLOWED_ON_CLOSED_METHODS
public static final java.util.Set<java.lang.String> NETWORK_BOUND_METHODS_FOR_ENTIRE_RESULTSET
public boolean isDialect(java.sql.Driver driver)
isDialect in interface TargetDriverDialectpublic boolean isDialect(java.lang.String dataSourceClass)
isDialect in interface TargetDriverDialectpublic ConnectInfo prepareConnectInfo(@NonNull java.lang.String protocol, @NonNull HostSpec hostSpec, @NonNull java.util.Properties props) throws java.sql.SQLException
prepareConnectInfo in interface TargetDriverDialectjava.sql.SQLExceptionpublic void prepareDataSource(@NonNull javax.sql.DataSource dataSource,
@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props)
throws java.sql.SQLException
prepareDataSource in interface TargetDriverDialectjava.sql.SQLExceptionpublic boolean isDriverRegistered()
throws java.sql.SQLException
isDriverRegistered in interface TargetDriverDialectjava.sql.SQLExceptionpublic void registerDriver()
throws java.sql.SQLException
registerDriver in interface TargetDriverDialectjava.sql.SQLExceptionpublic boolean ping(@NonNull java.sql.Connection connection)
TargetDriverDialectping in interface TargetDriverDialectconnection - The database connection to a node to ping.public java.util.Set<java.lang.String> getAllowedOnConnectionMethodNames()
getAllowedOnConnectionMethodNames in interface TargetDriverDialectpublic java.lang.String getSQLState(java.lang.Throwable throwable)
getSQLState in interface TargetDriverDialectpublic java.util.Set<java.lang.String> getNetworkBoundMethodNames(@Nullable java.util.Properties properties)
getNetworkBoundMethodNames in interface TargetDriverDialectpublic void abortConnection(@NonNull java.sql.Connection connectionToAbort,
@NonNull java.util.concurrent.Executor abortExecutor)
throws java.sql.SQLException
abortConnection in interface TargetDriverDialectjava.sql.SQLExceptionpublic @Nullable java.lang.String getSQLQueryString(java.sql.PreparedStatement ps)
getSQLQueryString in interface TargetDriverDialectpublic void registerDataType(@NonNull java.sql.Connection connection,
@NonNull java.lang.String typeName,
@NonNull java.lang.String className)
throws java.sql.SQLException
registerDataType in interface TargetDriverDialectjava.sql.SQLExceptionpublic void setEncryptedParameter(@NonNull java.sql.PreparedStatement ps,
int paramIndex,
byte[] encrypted)
throws java.sql.SQLException
setEncryptedParameter in interface TargetDriverDialectjava.sql.SQLExceptionpublic byte[] getEncryptedBytes(@NonNull java.sql.ResultSet rs,
java.lang.Object columnRef)
throws java.sql.SQLException
getEncryptedBytes in interface TargetDriverDialectjava.sql.SQLExceptionpublic void updateInternalState(@NonNull PluginService pluginService, @NonNull java.util.Properties props) throws java.sql.SQLException
TargetDriverDialectcurrentSchema) into
the wrapper's session state so they are preserved across connection switches
(failover, read-write splitting, initial connection strategy, etc.).
Each dialect implementation should inspect the provided properties for driver-specific
settings that affect session state and register them with the appropriate services
(e.g. SessionStateService).
This method is called once after the initial connection is established in
ConnectionWrapper.init().
updateInternalState in interface TargetDriverDialectpluginService - the plugin service providing access to session state and other servicesprops - the connection properties that may contain driver-specific settingsjava.sql.SQLException - if an error occurs while updating internal stateprotected @Nullable java.lang.String findSQLQueryString(java.sql.PreparedStatement ps,
@Nullable java.lang.String queryHeader)