public interface TargetDriverDialect
| Modifier and Type | Method and Description |
|---|---|
void |
abortConnection(@NonNull java.sql.Connection connectionToAbort,
@NonNull java.util.concurrent.Executor abortExecutor) |
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.
|
boolean isDialect(java.sql.Driver driver)
boolean isDialect(java.lang.String dataSourceClass)
ConnectInfo prepareConnectInfo(@NonNull java.lang.String protocol, @NonNull HostSpec hostSpec, @NonNull java.util.Properties props) throws java.sql.SQLException
java.sql.SQLExceptionvoid prepareDataSource(@NonNull javax.sql.DataSource dataSource,
@NonNull java.lang.String protocol,
@NonNull HostSpec hostSpec,
@NonNull java.util.Properties props)
throws java.sql.SQLException
java.sql.SQLExceptionboolean isDriverRegistered()
throws java.sql.SQLException
java.sql.SQLExceptionvoid registerDriver()
throws java.sql.SQLException
java.sql.SQLExceptionboolean ping(@NonNull java.sql.Connection connection)
connection - The database connection to a node to ping.java.util.Set<java.lang.String> getAllowedOnConnectionMethodNames()
java.lang.String getSQLState(java.lang.Throwable throwable)
java.util.Set<java.lang.String> getNetworkBoundMethodNames(@Nullable java.util.Properties properties)
void abortConnection(@NonNull java.sql.Connection connectionToAbort,
@NonNull java.util.concurrent.Executor abortExecutor)
throws java.sql.SQLException
java.sql.SQLException@Nullable java.lang.String getSQLQueryString(java.sql.PreparedStatement ps)
void registerDataType(@NonNull java.sql.Connection connection,
@NonNull java.lang.String typeName,
@NonNull java.lang.String className)
throws java.sql.SQLException
java.sql.SQLExceptionvoid setEncryptedParameter(@NonNull java.sql.PreparedStatement ps,
int paramIndex,
byte[] encrypted)
throws java.sql.SQLException
java.sql.SQLExceptionbyte[] getEncryptedBytes(@NonNull java.sql.ResultSet rs,
java.lang.Object columnRef)
throws java.sql.SQLException
java.sql.SQLExceptionvoid updateInternalState(@NonNull PluginService pluginService, @NonNull java.util.Properties props) throws java.sql.SQLException
currentSchema) 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().
pluginService - 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 state