Class ConnectionImpl

java.lang.Object
com.mysql.cj.jdbc.ConnectionImpl
All Implemented Interfaces:
JdbcConnection, MysqlConnection, Session.SessionEventListener, TransactionEventHandler, java.io.Serializable, java.lang.AutoCloseable, java.sql.Connection, java.sql.Wrapper

public class ConnectionImpl
extends java.lang.Object
implements JdbcConnection, Session.SessionEventListener, java.io.Serializable
A Connection represents a session with a specific database. Within the context of a Connection, SQL statements are executed and results are returned.

A Connection's database is able to provide information describing its tables, its supported SQL grammar, its stored procedures, the capabilities of this connection, etc. This information is obtained with the getMetaData method.

See Also:
Serialized Form
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.util.Map<?,​?> charsetMap
    The mapping between MySQL charset names and Java charset names.
    protected static java.lang.String DEFAULT_LOGGER_CLASS
    Default logger class name
    protected ResultSetFactory nullStatementResultSetFactory  
    protected JdbcPropertySet propertySet  
    protected java.util.Properties props
    Properties for this connection specified by user
    protected LRUCache<java.lang.String,​CachedResultSetMetaData> resultSetMetadataCache
    Cache of ResultSet metadata
    protected static java.util.Map<?,​?> roundRobinStatsMap  

    Fields inherited from interface java.sql.Connection

    TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected ConnectionImpl()
    ' For the delegate only
      ConnectionImpl​(HostInfo hostInfo)
    Creates a connection to a MySQL Server.
  • Method Summary

    Modifier and Type Method Description
    void abort​(java.util.concurrent.Executor executor)  
    void abortInternal()
    Clobbers the physical network connection and marks this connection as closed.
    void changeUser​(java.lang.String userName, java.lang.String newPassword)
    Changes the user on this connection by performing a re-authentication.
    void checkClosed()  
    void cleanup​(java.lang.Throwable whyCleanedUp)
    Destroys this connection and any underlying resources.
    void clearHasTriedMaster()
    Deprecated.
    void clearWarnings()  
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int autoGenKeyIndex)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, boolean processEscapeCodesIfNeeded)  
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames)
    Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    void close()  
    void commit()  
    java.sql.Array createArrayOf​(java.lang.String typeName, java.lang.Object[] elements)  
    java.sql.Blob createBlob()  
    java.sql.Clob createClob()  
    java.sql.NClob createNClob()  
    void createNewIO​(boolean isForReconnect)
    Creates an IO channel to the server.
    java.sql.SQLXML createSQLXML()  
    java.sql.Statement createStatement()  
    java.sql.Statement createStatement​(int resultSetType, int resultSetConcurrency)  
    java.sql.Statement createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability)  
    java.sql.Struct createStruct​(java.lang.String typeName, java.lang.Object[] attributes)  
    void decachePreparedStatement​(JdbcPreparedStatement pstmt)  
    JdbcConnection getActiveMySQLConnection()  
    int getActiveStatementCount()
    Returns the number of statements active on this connection, which haven't been .close()d.
    boolean getAutoCommit()  
    int getAutoIncrementIncrement()
    Returns the -session- value of 'auto_increment_increment' from the server if it exists, or '1' if not.
    CachedResultSetMetaData getCachedMetaData​(java.lang.String sql)
    Returns cached metadata (or null if not cached) for the given query, which must match _exactly_.
    java.lang.String getCatalog()  
    java.lang.String getCharacterSetMetadata()  
    java.util.Properties getClientInfo()  
    java.lang.String getClientInfo​(java.lang.String name)  
    ClientInfoProvider getClientInfoProviderImpl()  
    java.lang.Object getConnectionMutex()  
    java.lang.String getDatabase()
    Retrieves this connection object's current database name.
    ExceptionInterceptor getExceptionInterceptor()  
    int getHoldability()  
    java.lang.String getHost()  
    java.lang.String getHostPortPair()  
    long getId()  
    long getIdleFor()
    NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle.
    static JdbcConnection getInstance​(HostInfo hostInfo)
    Creates a connection instance.
    java.sql.DatabaseMetaData getMetaData()  
    java.sql.Statement getMetadataSafeStatement()  
    java.sql.Statement getMetadataSafeStatement​(int maxRows)  
    JdbcConnection getMultiHostParentProxy()  
    JdbcConnection getMultiHostSafeProxy()  
    int getNetworkTimeout()  
    protected static int getNextRoundRobinHostIndex​(java.lang.String url, java.util.List<?> hostList)  
    java.util.Properties getProperties()
    Returns the parsed and passed in properties for this connection.
    JdbcPropertySet getPropertySet()  
    java.util.List<QueryInterceptor> getQueryInterceptorsInstances()  
    java.lang.String getSchema()  
    ServerVersion getServerVersion()  
    NativeSession getSession()  
    int getSessionMaxRows()
    Returns the sql select limit max-rows for this session.
    java.lang.String getStatementComment()
    Returns the comment that will be prepended to all statements sent to the server.
    int getTransactionIsolation()  
    java.util.Map<java.lang.String,​java.lang.Class<?>> getTypeMap()  
    java.lang.String getURL()  
    java.lang.String getUser()  
    java.sql.SQLWarning getWarnings()  
    void handleCleanup​(java.lang.Throwable whyCleanedUp)  
    void handleNormalClose()  
    void handleReconnect()  
    boolean hasSameProperties​(JdbcConnection c)
    Does this connection have the same properties as another?
    boolean hasTriedMaster()
    Deprecated.
    void initializeResultsMetadataFromCache​(java.lang.String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet)
    Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key.
    void initializeSafeQueryInterceptors()  
    boolean isClosed()  
    boolean isInGlobalTx()
    Is this connection currently a participant in an XA transaction?
    boolean isProxySet()  
    boolean isReadOnly()  
    boolean isReadOnly​(boolean useSessionStatus)
    Tests to see if the connection is in Read Only Mode.
    boolean isSameResource​(JdbcConnection otherConnection)
    Does this connection have the same resource name as the given connection (for XA)?
    boolean isServerLocal()
    Is the server this connection is connected to "local" (i.e.
    boolean isSourceConnection()
    Is this connection connected to the first host in the list if there is a list of servers in the URL?
    boolean isValid​(int timeout)  
    boolean isWrapperFor​(java.lang.Class<?> iface)  
    boolean lowerCaseTableNames()
    Is the server configured to use lower-case table names only?
    java.lang.String nativeSQL​(java.lang.String sql)  
    void normalClose()  
    void ping()
    Detect if the connection is still good by sending a ping command to the server.
    void pingInternal​(boolean checkForClosedConnection, int timeoutMillis)  
    java.sql.CallableStatement prepareCall​(java.lang.String sql)  
    java.sql.CallableStatement prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency)  
    java.sql.CallableStatement prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int autoGenKeyIndex)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)  
    java.sql.PreparedStatement prepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames)  
    void realClose​(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, java.lang.Throwable reason)
    Closes connection and frees resources.
    void recachePreparedStatement​(JdbcPreparedStatement pstmt)  
    void registerStatement​(JdbcStatement stmt)
    Register a Statement instance as open.
    void releaseSavepoint​(java.sql.Savepoint arg0)  
    void resetServerState()
    Resets the server-side state of this connection.
    void rollback()  
    void rollback​(java.sql.Savepoint savepoint)  
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int autoGenKeyIndex)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames)
    Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
    void setAutoCommit​(boolean autoCommitFlag)  
    void setCatalog​(java.lang.String catalog)  
    void setClientInfo​(java.lang.String name, java.lang.String value)  
    void setClientInfo​(java.util.Properties properties)  
    void setDatabase​(java.lang.String db)
    Set current database for this connection.
    void setFailedOver​(boolean flag)  
    void setHoldability​(int arg0)  
    void setInGlobalTx​(boolean flag)
    Set the state of being in a global (XA) transaction.
    void setNetworkTimeout​(java.util.concurrent.Executor executor, int milliseconds)  
    void setProxy​(JdbcConnection proxy)  
    void setReadOnly​(boolean readOnlyFlag)  
    void setReadOnlyInternal​(boolean readOnlyFlag)  
    java.sql.Savepoint setSavepoint()  
    java.sql.Savepoint setSavepoint​(java.lang.String name)  
    void setSchema​(java.lang.String schema)  
    void setSessionMaxRows​(int max)
    Sets the sql select limit max-rows for this session if different from current.
    void setStatementComment​(java.lang.String comment)
    Sets the comment that will be prepended to all statements sent to the server.
    void setTransactionIsolation​(int level)  
    void setTypeMap​(java.util.Map<java.lang.String,​java.lang.Class<?>> map)  
    void shutdownServer()
    Used by MiniAdmin to shutdown a MySQL server
    boolean storesLowerCaseTableName()  
    void throwConnectionClosedException()  
    void transactionBegun()  
    void transactionCompleted()  
    void unregisterStatement​(JdbcStatement stmt)
    Remove the given statement from the list of open statements
    void unSafeQueryInterceptors()  
    <T> T unwrap​(java.lang.Class<T> iface)  
    boolean versionMeetsMinimum​(int major, int minor, int subminor)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.sql.Connection

    beginRequest, endRequest, setShardingKey, setShardingKey, setShardingKeyIfValid, setShardingKeyIfValid

    Methods inherited from interface com.mysql.cj.jdbc.JdbcConnection

    isMasterConnection
  • Field Details

  • Constructor Details

    • ConnectionImpl

      protected ConnectionImpl()
      ' For the delegate only
    • ConnectionImpl

      public ConnectionImpl​(HostInfo hostInfo) throws java.sql.SQLException
      Creates a connection to a MySQL Server.
      Parameters:
      hostInfo - the HostInfo instance that contains the host, user and connections attributes for this connection
      Throws:
      java.sql.SQLException - if a database access error occurs
  • Method Details

    • getHost

      public java.lang.String getHost()
      Specified by:
      getHost in interface JdbcConnection
    • isProxySet

      public boolean isProxySet()
      Specified by:
      isProxySet in interface JdbcConnection
    • setProxy

      public void setProxy​(JdbcConnection proxy)
      Specified by:
      setProxy in interface JdbcConnection
    • getMultiHostSafeProxy

      public JdbcConnection getMultiHostSafeProxy()
      Specified by:
      getMultiHostSafeProxy in interface JdbcConnection
    • getMultiHostParentProxy

      public JdbcConnection getMultiHostParentProxy()
      Specified by:
      getMultiHostParentProxy in interface JdbcConnection
    • getActiveMySQLConnection

      public JdbcConnection getActiveMySQLConnection()
      Specified by:
      getActiveMySQLConnection in interface JdbcConnection
    • getConnectionMutex

      public java.lang.Object getConnectionMutex()
      Specified by:
      getConnectionMutex in interface MysqlConnection
    • getInstance

      public static JdbcConnection getInstance​(HostInfo hostInfo) throws java.sql.SQLException
      Creates a connection instance.
      Parameters:
      hostInfo - HostInfo instance
      Returns:
      new ConnectionImpl instance
      Throws:
      java.sql.SQLException - if a database access error occurs
    • getNextRoundRobinHostIndex

      protected static int getNextRoundRobinHostIndex​(java.lang.String url, java.util.List<?> hostList)
      Parameters:
      url - connection URL
      hostList - hosts list
      Returns:
      index in a host list
    • getPropertySet

      public JdbcPropertySet getPropertySet()
      Specified by:
      getPropertySet in interface JdbcConnection
      Specified by:
      getPropertySet in interface MysqlConnection
    • unSafeQueryInterceptors

      public void unSafeQueryInterceptors() throws java.sql.SQLException
      Specified by:
      unSafeQueryInterceptors in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • initializeSafeQueryInterceptors

      public void initializeSafeQueryInterceptors() throws java.sql.SQLException
      Specified by:
      initializeSafeQueryInterceptors in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • getQueryInterceptorsInstances

      public java.util.List<QueryInterceptor> getQueryInterceptorsInstances()
      Specified by:
      getQueryInterceptorsInstances in interface JdbcConnection
    • changeUser

      public void changeUser​(java.lang.String userName, java.lang.String newPassword) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Changes the user on this connection by performing a re-authentication. If authentication fails, the connection is failed.
      Specified by:
      changeUser in interface JdbcConnection
      Parameters:
      userName - the username to authenticate with
      newPassword - the password to authenticate with
      Throws:
      java.sql.SQLException - if authentication fails, or some other error occurs while performing the command.
    • checkClosed

      public void checkClosed()
      Specified by:
      checkClosed in interface MysqlConnection
    • throwConnectionClosedException

      public void throwConnectionClosedException() throws java.sql.SQLException
      Specified by:
      throwConnectionClosedException in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • abortInternal

      public void abortInternal() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Clobbers the physical network connection and marks this connection as closed.
      Specified by:
      abortInternal in interface JdbcConnection
      Throws:
      java.sql.SQLException - if an error occurs
    • cleanup

      public void cleanup​(java.lang.Throwable whyCleanedUp)
      Description copied from interface: MysqlConnection
      Destroys this connection and any underlying resources.
      Specified by:
      cleanup in interface MysqlConnection
      Parameters:
      whyCleanedUp - exception caused the connection clean up
    • clearHasTriedMaster

      @Deprecated public void clearHasTriedMaster()
      Deprecated.
      Specified by:
      clearHasTriedMaster in interface JdbcConnection
    • clearWarnings

      public void clearWarnings() throws java.sql.SQLException
      Specified by:
      clearWarnings in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String)
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int autoGenKeyIndex) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyIndex - autoGenKeyIndex
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int)
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      resultSetType - resultSetType
      resultSetConcurrency - resultSetConcurrency
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int, int)
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, boolean processEscapeCodesIfNeeded) throws java.sql.SQLException
      Throws:
      java.sql.SQLException
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyIndexes - autoGenKeyIndexes
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int[])
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyColNames - autoGenKeyColNames
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, String[])
    • clientPrepareStatement

      public java.sql.PreparedStatement clientPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the client, using client-side emulation (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      clientPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      resultSetType - resultSetType
      resultSetConcurrency - resultSetConcurrency
      resultSetHoldability - resultSetHoldability
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int, int, int)
    • close

      public void close() throws java.sql.SQLException
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • normalClose

      public void normalClose()
      Specified by:
      normalClose in interface MysqlConnection
    • commit

      public void commit() throws java.sql.SQLException
      Specified by:
      commit in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createNewIO

      public void createNewIO​(boolean isForReconnect)
      Description copied from interface: MysqlConnection
      Creates an IO channel to the server.
      Specified by:
      createNewIO in interface MysqlConnection
      Parameters:
      isForReconnect - is this request for a re-connect
    • createStatement

      public java.sql.Statement createStatement() throws java.sql.SQLException
      Specified by:
      createStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createStatement

      public java.sql.Statement createStatement​(int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Specified by:
      createStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createStatement

      public java.sql.Statement createStatement​(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Specified by:
      createStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getActiveStatementCount

      public int getActiveStatementCount()
      Description copied from interface: JdbcConnection
      Returns the number of statements active on this connection, which haven't been .close()d.
      Specified by:
      getActiveStatementCount in interface JdbcConnection
      Returns:
      the number of active statements
    • getAutoCommit

      public boolean getAutoCommit() throws java.sql.SQLException
      Specified by:
      getAutoCommit in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getCatalog

      public java.lang.String getCatalog() throws java.sql.SQLException
      Specified by:
      getCatalog in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getCharacterSetMetadata

      public java.lang.String getCharacterSetMetadata()
      Specified by:
      getCharacterSetMetadata in interface JdbcConnection
      Returns:
      Returns the characterSetMetadata.
    • getHoldability

      public int getHoldability() throws java.sql.SQLException
      Specified by:
      getHoldability in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getId

      public long getId()
      Specified by:
      getId in interface MysqlConnection
    • getIdleFor

      public long getIdleFor()
      NOT JDBC-Compliant, but clients can use this method to determine how long this connection has been idle. This time (reported in milliseconds) is updated once a query has completed.
      Specified by:
      getIdleFor in interface JdbcConnection
      Returns:
      number of ms that this connection has been idle, 0 if the driver is busy retrieving results.
    • getMetaData

      public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException
      Specified by:
      getMetaData in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getMetadataSafeStatement

      public java.sql.Statement getMetadataSafeStatement() throws java.sql.SQLException
      Specified by:
      getMetadataSafeStatement in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • getMetadataSafeStatement

      public java.sql.Statement getMetadataSafeStatement​(int maxRows) throws java.sql.SQLException
      Throws:
      java.sql.SQLException
    • getServerVersion

      public ServerVersion getServerVersion()
      Specified by:
      getServerVersion in interface JdbcConnection
    • getTransactionIsolation

      public int getTransactionIsolation() throws java.sql.SQLException
      Specified by:
      getTransactionIsolation in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getTypeMap

      public java.util.Map<java.lang.String,​java.lang.Class<?>> getTypeMap() throws java.sql.SQLException
      Specified by:
      getTypeMap in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getURL

      public java.lang.String getURL()
      Specified by:
      getURL in interface MysqlConnection
    • getUser

      public java.lang.String getUser()
      Specified by:
      getUser in interface MysqlConnection
    • getWarnings

      public java.sql.SQLWarning getWarnings() throws java.sql.SQLException
      Specified by:
      getWarnings in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • hasSameProperties

      public boolean hasSameProperties​(JdbcConnection c)
      Description copied from interface: JdbcConnection
      Does this connection have the same properties as another?
      Specified by:
      hasSameProperties in interface JdbcConnection
      Parameters:
      c - connection
      Returns:
      true if has the same properties
    • getProperties

      public java.util.Properties getProperties()
      Description copied from interface: MysqlConnection
      Returns the parsed and passed in properties for this connection.
      Specified by:
      getProperties in interface MysqlConnection
      Returns:
      Properties
    • hasTriedMaster

      @Deprecated public boolean hasTriedMaster()
      Deprecated.
      Description copied from interface: JdbcConnection
      Has this connection tried to execute a query on the "source" server (first host in a multiple host list).
      Specified by:
      hasTriedMaster in interface JdbcConnection
      Returns:
      true if it has tried
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface java.sql.Connection
    • isInGlobalTx

      public boolean isInGlobalTx()
      Description copied from interface: JdbcConnection
      Is this connection currently a participant in an XA transaction?
      Specified by:
      isInGlobalTx in interface JdbcConnection
      Returns:
      true if this connection currently a participant in an XA transaction
    • isSourceConnection

      public boolean isSourceConnection()
      Description copied from interface: JdbcConnection
      Is this connection connected to the first host in the list if there is a list of servers in the URL?
      Specified by:
      isSourceConnection in interface JdbcConnection
      Returns:
      true if this connection is connected to the first in the list.
    • isReadOnly

      public boolean isReadOnly() throws java.sql.SQLException
      Specified by:
      isReadOnly in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • isReadOnly

      public boolean isReadOnly​(boolean useSessionStatus) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Tests to see if the connection is in Read Only Mode.
      Specified by:
      isReadOnly in interface JdbcConnection
      Parameters:
      useSessionStatus - in some cases, for example when restoring connection with autoReconnect=true, we can rely only on saved readOnly state, so use useSessionStatus=false in that case
      Returns:
      true if the connection is read only
      Throws:
      java.sql.SQLException - if a database access error occurs
    • isSameResource

      public boolean isSameResource​(JdbcConnection otherConnection)
      Description copied from interface: JdbcConnection
      Does this connection have the same resource name as the given connection (for XA)?
      Specified by:
      isSameResource in interface JdbcConnection
      Parameters:
      otherConnection - connection
      Returns:
      true if it is the same one
    • getAutoIncrementIncrement

      public int getAutoIncrementIncrement()
      Description copied from interface: JdbcConnection
      Returns the -session- value of 'auto_increment_increment' from the server if it exists, or '1' if not.
      Specified by:
      getAutoIncrementIncrement in interface JdbcConnection
      Returns:
      the -session- value of 'auto_increment_increment'
    • lowerCaseTableNames

      public boolean lowerCaseTableNames()
      Description copied from interface: JdbcConnection
      Is the server configured to use lower-case table names only?
      Specified by:
      lowerCaseTableNames in interface JdbcConnection
      Returns:
      true if lower_case_table_names is 'on'
    • nativeSQL

      public java.lang.String nativeSQL​(java.lang.String sql) throws java.sql.SQLException
      Specified by:
      nativeSQL in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • ping

      public void ping() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Detect if the connection is still good by sending a ping command to the server.
      Specified by:
      ping in interface JdbcConnection
      Throws:
      java.sql.SQLException - if the ping fails
    • pingInternal

      public void pingInternal​(boolean checkForClosedConnection, int timeoutMillis) throws java.sql.SQLException
      Specified by:
      pingInternal in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • prepareCall

      public java.sql.CallableStatement prepareCall​(java.lang.String sql) throws java.sql.SQLException
      Specified by:
      prepareCall in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareCall

      public java.sql.CallableStatement prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Specified by:
      prepareCall in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareCall

      public java.sql.CallableStatement prepareCall​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Specified by:
      prepareCall in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int autoGenKeyIndex) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • prepareStatement

      public java.sql.PreparedStatement prepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames) throws java.sql.SQLException
      Specified by:
      prepareStatement in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • realClose

      public void realClose​(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, java.lang.Throwable reason) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Closes connection and frees resources.
      Specified by:
      realClose in interface JdbcConnection
      Parameters:
      calledExplicitly - is this being called from close()
      issueRollback - should a rollback() be issued?
      skipLocalTeardown - if true, driver tries to close connection normally, performing rollbacks, closing open statements etc; otherwise the force close is performed
      reason - the exception caused this method call
      Throws:
      java.sql.SQLException - if an error occurs
    • recachePreparedStatement

      public void recachePreparedStatement​(JdbcPreparedStatement pstmt) throws java.sql.SQLException
      Specified by:
      recachePreparedStatement in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • decachePreparedStatement

      public void decachePreparedStatement​(JdbcPreparedStatement pstmt) throws java.sql.SQLException
      Specified by:
      decachePreparedStatement in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • registerStatement

      public void registerStatement​(JdbcStatement stmt)
      Description copied from interface: JdbcConnection
      Register a Statement instance as open.
      Specified by:
      registerStatement in interface JdbcConnection
      Parameters:
      stmt - the Statement instance to remove
    • releaseSavepoint

      public void releaseSavepoint​(java.sql.Savepoint arg0) throws java.sql.SQLException
      Specified by:
      releaseSavepoint in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • resetServerState

      public void resetServerState() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Resets the server-side state of this connection. Doesn't work if isParanoid() is set (it will become a no-op in this case). Usually only used from connection pooling code.
      Specified by:
      resetServerState in interface JdbcConnection
      Throws:
      java.sql.SQLException - if the operation fails while resetting server state.
    • rollback

      public void rollback() throws java.sql.SQLException
      Specified by:
      rollback in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • rollback

      public void rollback​(java.sql.Savepoint savepoint) throws java.sql.SQLException
      Specified by:
      rollback in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String)
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int autoGenKeyIndex) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyIndex - autoGenKeyIndex
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int)
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      resultSetType - resultSetType
      resultSetConcurrency - resultSetConcurrency
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int, int)
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      resultSetType - resultSetType
      resultSetConcurrency - resultSetConcurrency
      resultSetHoldability - resultSetHoldability
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int, int, int)
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, int[] autoGenKeyIndexes) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyIndexes - autoGenKeyIndexes
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, int[])
    • serverPrepareStatement

      public java.sql.PreparedStatement serverPrepareStatement​(java.lang.String sql, java.lang.String[] autoGenKeyColNames) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Prepares a statement on the server (irregardless of the configuration property 'useServerPrepStmts') with the same semantics as the java.sql.Connection.prepareStatement() method with the same argument types.
      Specified by:
      serverPrepareStatement in interface JdbcConnection
      Parameters:
      sql - statement
      autoGenKeyColNames - autoGenKeyColNames
      Returns:
      prepared statement
      Throws:
      java.sql.SQLException - if an error occurs
      See Also:
      Connection.prepareStatement(String, String[])
    • setAutoCommit

      public void setAutoCommit​(boolean autoCommitFlag) throws java.sql.SQLException
      Specified by:
      setAutoCommit in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setCatalog

      public void setCatalog​(java.lang.String catalog) throws java.sql.SQLException
      Specified by:
      setCatalog in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setDatabase

      public void setDatabase​(java.lang.String db) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Set current database for this connection.
      Specified by:
      setDatabase in interface JdbcConnection
      Parameters:
      db - the database for this connection to use
      Throws:
      java.sql.SQLException - if a database access error occurs
    • getDatabase

      public java.lang.String getDatabase() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Retrieves this connection object's current database name.
      Specified by:
      getDatabase in interface JdbcConnection
      Returns:
      current database name
      Throws:
      java.sql.SQLException - if an error occurs
    • setFailedOver

      public void setFailedOver​(boolean flag)
      Specified by:
      setFailedOver in interface JdbcConnection
      Parameters:
      flag - The failedOver flag to set.
    • setHoldability

      public void setHoldability​(int arg0) throws java.sql.SQLException
      Specified by:
      setHoldability in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setInGlobalTx

      public void setInGlobalTx​(boolean flag)
      Description copied from interface: JdbcConnection
      Set the state of being in a global (XA) transaction.
      Specified by:
      setInGlobalTx in interface JdbcConnection
      Parameters:
      flag - the state flag
    • setReadOnly

      public void setReadOnly​(boolean readOnlyFlag) throws java.sql.SQLException
      Specified by:
      setReadOnly in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setReadOnlyInternal

      public void setReadOnlyInternal​(boolean readOnlyFlag) throws java.sql.SQLException
      Specified by:
      setReadOnlyInternal in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • setSavepoint

      public java.sql.Savepoint setSavepoint() throws java.sql.SQLException
      Specified by:
      setSavepoint in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setSavepoint

      public java.sql.Savepoint setSavepoint​(java.lang.String name) throws java.sql.SQLException
      Specified by:
      setSavepoint in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setTransactionIsolation

      public void setTransactionIsolation​(int level) throws java.sql.SQLException
      Specified by:
      setTransactionIsolation in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setTypeMap

      public void setTypeMap​(java.util.Map<java.lang.String,​java.lang.Class<?>> map) throws java.sql.SQLException
      Specified by:
      setTypeMap in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • shutdownServer

      public void shutdownServer() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Used by MiniAdmin to shutdown a MySQL server
      Specified by:
      shutdownServer in interface JdbcConnection
      Throws:
      java.sql.SQLException - if the command can not be issued.
    • unregisterStatement

      public void unregisterStatement​(JdbcStatement stmt)
      Description copied from interface: JdbcConnection
      Remove the given statement from the list of open statements
      Specified by:
      unregisterStatement in interface JdbcConnection
      Parameters:
      stmt - the Statement instance to remove
    • versionMeetsMinimum

      public boolean versionMeetsMinimum​(int major, int minor, int subminor)
    • getCachedMetaData

      public CachedResultSetMetaData getCachedMetaData​(java.lang.String sql)
      Description copied from interface: JdbcConnection
      Returns cached metadata (or null if not cached) for the given query, which must match _exactly_. This method is synchronized by the caller on getMutex(), so if calling this method from internal code in the driver, make sure it's synchronized on the mutex that guards communication with the server.
      Specified by:
      getCachedMetaData in interface JdbcConnection
      Parameters:
      sql - the query that is the key to the cache
      Returns:
      metadata cached for the given SQL, or none if it doesn't exist.
    • initializeResultsMetadataFromCache

      public void initializeResultsMetadataFromCache​(java.lang.String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Caches CachedResultSetMetaData that has been placed in the cache using the given SQL as a key. This method is synchronized by the caller on getMutex(), so if calling this method from internal code in the driver, make sure it's synchronized on the mutex that guards communication with the server.
      Specified by:
      initializeResultsMetadataFromCache in interface JdbcConnection
      Parameters:
      sql - the query that the metadata pertains too.
      cachedMetaData - metadata (if it exists) to populate the cache.
      resultSet - the result set to retreive metadata from, or apply to.
      Throws:
      java.sql.SQLException - if an error occurs
    • getStatementComment

      public java.lang.String getStatementComment()
      Description copied from interface: JdbcConnection
      Returns the comment that will be prepended to all statements sent to the server.
      Specified by:
      getStatementComment in interface JdbcConnection
      Returns:
      the comment that will be prepended to all statements sent to the server.
    • setStatementComment

      public void setStatementComment​(java.lang.String comment)
      Description copied from interface: JdbcConnection
      Sets the comment that will be prepended to all statements sent to the server. Do not use slash-star or star-slash tokens in the comment as these will be added by the driver itself.
      Specified by:
      setStatementComment in interface JdbcConnection
      Parameters:
      comment - the comment that will be prepended to all statements sent to the server.
    • transactionBegun

      public void transactionBegun()
      Specified by:
      transactionBegun in interface TransactionEventHandler
    • transactionCompleted

      public void transactionCompleted()
      Specified by:
      transactionCompleted in interface TransactionEventHandler
    • storesLowerCaseTableName

      public boolean storesLowerCaseTableName()
      Specified by:
      storesLowerCaseTableName in interface JdbcConnection
    • getExceptionInterceptor

      public ExceptionInterceptor getExceptionInterceptor()
      Specified by:
      getExceptionInterceptor in interface MysqlConnection
    • isServerLocal

      public boolean isServerLocal() throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Is the server this connection is connected to "local" (i.e. same host) as the application?
      Specified by:
      isServerLocal in interface JdbcConnection
      Returns:
      true if the server is "local"
      Throws:
      java.sql.SQLException - if an error occurs
    • getSessionMaxRows

      public int getSessionMaxRows()
      Description copied from interface: JdbcConnection
      Returns the sql select limit max-rows for this session.
      Specified by:
      getSessionMaxRows in interface JdbcConnection
      Returns:
      int max rows
    • setSessionMaxRows

      public void setSessionMaxRows​(int max) throws java.sql.SQLException
      Description copied from interface: JdbcConnection
      Sets the sql select limit max-rows for this session if different from current.
      Specified by:
      setSessionMaxRows in interface JdbcConnection
      Parameters:
      max - the new max-rows value to set.
      Throws:
      java.sql.SQLException - if a database error occurs issuing the statement that sets the limit.
    • setSchema

      public void setSchema​(java.lang.String schema) throws java.sql.SQLException
      Specified by:
      setSchema in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getSchema

      public java.lang.String getSchema() throws java.sql.SQLException
      Specified by:
      getSchema in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • abort

      public void abort​(java.util.concurrent.Executor executor) throws java.sql.SQLException
      Specified by:
      abort in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • setNetworkTimeout

      public void setNetworkTimeout​(java.util.concurrent.Executor executor, int milliseconds) throws java.sql.SQLException
      Specified by:
      setNetworkTimeout in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getNetworkTimeout

      public int getNetworkTimeout() throws java.sql.SQLException
      Specified by:
      getNetworkTimeout in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createClob

      public java.sql.Clob createClob()
      Specified by:
      createClob in interface java.sql.Connection
    • createBlob

      public java.sql.Blob createBlob()
      Specified by:
      createBlob in interface java.sql.Connection
    • createNClob

      public java.sql.NClob createNClob()
      Specified by:
      createNClob in interface java.sql.Connection
    • createSQLXML

      public java.sql.SQLXML createSQLXML() throws java.sql.SQLException
      Specified by:
      createSQLXML in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • isValid

      public boolean isValid​(int timeout) throws java.sql.SQLException
      Specified by:
      isValid in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getClientInfoProviderImpl

      public ClientInfoProvider getClientInfoProviderImpl() throws java.sql.SQLException
      Specified by:
      getClientInfoProviderImpl in interface JdbcConnection
      Throws:
      java.sql.SQLException
    • setClientInfo

      public void setClientInfo​(java.lang.String name, java.lang.String value) throws java.sql.SQLClientInfoException
      Specified by:
      setClientInfo in interface java.sql.Connection
      Throws:
      java.sql.SQLClientInfoException
    • setClientInfo

      public void setClientInfo​(java.util.Properties properties) throws java.sql.SQLClientInfoException
      Specified by:
      setClientInfo in interface java.sql.Connection
      Throws:
      java.sql.SQLClientInfoException
    • getClientInfo

      public java.lang.String getClientInfo​(java.lang.String name) throws java.sql.SQLException
      Specified by:
      getClientInfo in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • getClientInfo

      public java.util.Properties getClientInfo() throws java.sql.SQLException
      Specified by:
      getClientInfo in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createArrayOf

      public java.sql.Array createArrayOf​(java.lang.String typeName, java.lang.Object[] elements) throws java.sql.SQLException
      Specified by:
      createArrayOf in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • createStruct

      public java.sql.Struct createStruct​(java.lang.String typeName, java.lang.Object[] attributes) throws java.sql.SQLException
      Specified by:
      createStruct in interface java.sql.Connection
      Throws:
      java.sql.SQLException
    • unwrap

      public <T> T unwrap​(java.lang.Class<T> iface) throws java.sql.SQLException
      Specified by:
      unwrap in interface java.sql.Wrapper
      Throws:
      java.sql.SQLException
    • isWrapperFor

      public boolean isWrapperFor​(java.lang.Class<?> iface) throws java.sql.SQLException
      Specified by:
      isWrapperFor in interface java.sql.Wrapper
      Throws:
      java.sql.SQLException
    • getSession

      public NativeSession getSession()
      Specified by:
      getSession in interface MysqlConnection
    • getHostPortPair

      public java.lang.String getHostPortPair()
      Specified by:
      getHostPortPair in interface JdbcConnection
    • handleNormalClose

      public void handleNormalClose()
      Specified by:
      handleNormalClose in interface Session.SessionEventListener
    • handleReconnect

      public void handleReconnect()
      Specified by:
      handleReconnect in interface Session.SessionEventListener
    • handleCleanup

      public void handleCleanup​(java.lang.Throwable whyCleanedUp)
      Specified by:
      handleCleanup in interface Session.SessionEventListener