Interface MySQLConnection

All Superinterfaces:
AutoCloseable, Connection, Connection, ConnectionProperties, Wrapper
All Known Subinterfaces:
JDBC4MySQLConnection, LoadBalancedConnection, ReplicationConnection
All Known Implementing Classes:
ConnectionImpl, JDBC4Connection, JDBC4LoadBalancedMySQLConnection, JDBC4MultiHostMySQLConnection, JDBC4ReplicationMySQLConnection, LoadBalancedMySQLConnection, MultiHostMySQLConnection, ReplicationMySQLConnection

public interface MySQLConnection extends Connection, ConnectionProperties
  • Method Details

    • isProxySet

      boolean isProxySet()
    • createNewIO

      void createNewIO(boolean isForReconnect) throws SQLException
      Throws:
      SQLException
    • dumpTestcaseQuery

      void dumpTestcaseQuery(String query)
    • duplicate

      Connection duplicate() throws SQLException
      Throws:
      SQLException
    • execSQL

      ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata) throws SQLException
      Throws:
      SQLException
    • execSQL

      ResultSetInternalMethods execSQL(StatementImpl callingStatement, String sql, int maxRows, Buffer packet, int resultSetType, int resultSetConcurrency, boolean streamResults, String catalog, Field[] cachedMetadata, boolean isBatch) throws SQLException
      Throws:
      SQLException
    • extractSqlFromPacket

      String extractSqlFromPacket(String possibleSqlQuery, Buffer queryPacket, int endOfQueryPacketPosition) throws SQLException
      Throws:
      SQLException
    • generateConnectionCommentBlock

      StringBuilder generateConnectionCommentBlock(StringBuilder buf)
    • getActiveStatementCount

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

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

      CachedResultSetMetaData getCachedMetaData(String sql)
    • getCalendarInstanceForSessionOrNew

      Calendar getCalendarInstanceForSessionOrNew()
    • getCancelTimer

      Timer getCancelTimer()
    • getCharacterSetMetadata

      String getCharacterSetMetadata()
    • getCharsetConverter

      SingleByteCharsetConverter getCharsetConverter(String javaEncodingName) throws SQLException
      Throws:
      SQLException
    • getCharsetNameForIndex

      @Deprecated String getCharsetNameForIndex(int charsetIndex) throws SQLException
      Deprecated.
      replaced by getEncodingForIndex(int collationIndex)
      Throws:
      SQLException
    • getEncodingForIndex

      String getEncodingForIndex(int collationIndex) throws SQLException
      Throws:
      SQLException
    • getDefaultTimeZone

      TimeZone getDefaultTimeZone()
    • getErrorMessageEncoding

      String getErrorMessageEncoding()
    • getExceptionInterceptor

      ExceptionInterceptor getExceptionInterceptor()
      Specified by:
      getExceptionInterceptor in interface ConnectionProperties
    • getHost

      String getHost()
      Specified by:
      getHost in interface Connection
    • getHostPortPair

      String getHostPortPair()
    • getId

      long getId()
    • getIdleFor

      long getIdleFor()
      Description copied from interface: Connection
      Reports how long this connection has been idle. This time (reported in milliseconds) is updated once a query has completed.
      Specified by:
      getIdleFor in interface Connection
      Returns:
      number of ms that this connection has been idle, 0 if the driver is busy retrieving results.
    • getIO

      MysqlIO getIO() throws SQLException
      Throws:
      SQLException
    • getLog

      com.mysql.jdbc.log.Log getLog() throws SQLException
      Description copied from interface: Connection
      Returns the log mechanism that should be used to log information from/for this Connection.
      Specified by:
      getLog in interface Connection
      Returns:
      the Log instance to use for logging messages.
      Throws:
      SQLException - if an error occurs
    • getMaxBytesPerChar

      int getMaxBytesPerChar(String javaCharsetName) throws SQLException
      Throws:
      SQLException
    • getMaxBytesPerChar

      int getMaxBytesPerChar(Integer charsetIndex, String javaCharsetName) throws SQLException
      Throws:
      SQLException
    • getMetadataSafeStatement

      Statement getMetadataSafeStatement() throws SQLException
      Throws:
      SQLException
    • getNetBufferLength

      int getNetBufferLength()
    • getProperties

      Properties getProperties()
      Description copied from interface: Connection
      Returns the parsed and passed in properties for this connection.
      Specified by:
      getProperties in interface Connection
    • getRequiresEscapingEncoder

      boolean getRequiresEscapingEncoder()
    • getServerCharset

      String getServerCharset()
      Description copied from interface: Connection
      Returns the server's character set
      Specified by:
      getServerCharset in interface Connection
      Returns:
      the server's character set.
    • getServerMajorVersion

      int getServerMajorVersion()
    • getServerMinorVersion

      int getServerMinorVersion()
    • getServerSubMinorVersion

      int getServerSubMinorVersion()
    • getServerTimezoneTZ

      TimeZone getServerTimezoneTZ()
      Description copied from interface: Connection
      Returns the TimeZone that represents the configured timezone for the server.
      Specified by:
      getServerTimezoneTZ in interface Connection
    • getServerVariable

      String getServerVariable(String variableName)
    • getServerVersion

      String getServerVersion()
    • getSessionLockedCalendar

      Calendar getSessionLockedCalendar()
    • getStatementComment

      String getStatementComment()
      Description copied from interface: Connection
      Returns the comment that will be prepended to all statements sent to the server.
      Specified by:
      getStatementComment in interface Connection
      Returns:
      the comment that will be prepended to all statements sent to the server.
    • getStatementInterceptorsInstances

      List<StatementInterceptorV2> getStatementInterceptorsInstances()
    • getURL

      String getURL()
    • getUser

      String getUser()
    • getUtcCalendar

      Calendar getUtcCalendar()
    • incrementNumberOfPreparedExecutes

      void incrementNumberOfPreparedExecutes()
    • incrementNumberOfPrepares

      void incrementNumberOfPrepares()
    • incrementNumberOfResultSetsCreated

      void incrementNumberOfResultSetsCreated()
    • initializeResultsMetadataFromCache

      void initializeResultsMetadataFromCache(String sql, CachedResultSetMetaData cachedMetaData, ResultSetInternalMethods resultSet) throws SQLException
      Throws:
      SQLException
    • initializeSafeStatementInterceptors

      void initializeSafeStatementInterceptors() throws SQLException
      Throws:
      SQLException
    • isAbonormallyLongQuery

      boolean isAbonormallyLongQuery(long millisOrNanos)
      Update statistics that allows the driver to determine if a query is slow enough to be logged, and return the estimation result for millisOrNanos value.

      Used in case autoSlowLog=true.

      Specified by:
      isAbonormallyLongQuery in interface Connection
      Parameters:
      millisOrNanos - query execution time
      Returns:
      true if millisOrNanos is outside the 99th percentile?
    • isClientTzUTC

      boolean isClientTzUTC()
    • isCursorFetchEnabled

      boolean isCursorFetchEnabled() throws SQLException
      Throws:
      SQLException
    • isReadInfoMsgEnabled

      boolean isReadInfoMsgEnabled()
    • isReadOnly

      boolean isReadOnly() throws SQLException
      Specified by:
      isReadOnly in interface Connection
      Throws:
      SQLException
    • isReadOnly

      boolean isReadOnly(boolean useSessionStatus) throws SQLException
      Throws:
      SQLException
    • isRunningOnJDK13

      boolean isRunningOnJDK13()
    • isServerTzUTC

      boolean isServerTzUTC()
    • lowerCaseTableNames

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

      void pingInternal(boolean checkForClosedConnection, int timeoutMillis) throws SQLException
      Throws:
      SQLException
    • realClose

      void realClose(boolean calledExplicitly, boolean issueRollback, boolean skipLocalTeardown, Throwable reason) throws SQLException
      Throws:
      SQLException
    • recachePreparedStatement

      void recachePreparedStatement(ServerPreparedStatement pstmt) throws SQLException
      Throws:
      SQLException
    • decachePreparedStatement

      void decachePreparedStatement(ServerPreparedStatement pstmt) throws SQLException
      Throws:
      SQLException
    • registerQueryExecutionTime

      void registerQueryExecutionTime(long queryTimeMs)
    • registerStatement

      void registerStatement(Statement stmt)
    • reportNumberOfTablesAccessed

      void reportNumberOfTablesAccessed(int numTablesAccessed)
    • serverSupportsConvertFn

      boolean serverSupportsConvertFn() throws SQLException
      Throws:
      SQLException
    • setProxy

      void setProxy(MySQLConnection proxy)
      Specified by:
      setProxy in interface Connection
    • setReadInfoMsgEnabled

      void setReadInfoMsgEnabled(boolean flag)
    • setReadOnlyInternal

      void setReadOnlyInternal(boolean readOnlyFlag) throws SQLException
      Throws:
      SQLException
    • shutdownServer

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

      boolean storesLowerCaseTableName()
    • throwConnectionClosedException

      void throwConnectionClosedException() throws SQLException
      Throws:
      SQLException
    • transactionBegun

      void transactionBegun() throws SQLException
      Throws:
      SQLException
    • transactionCompleted

      void transactionCompleted() throws SQLException
      Throws:
      SQLException
    • unregisterStatement

      void unregisterStatement(Statement stmt)
    • unSafeStatementInterceptors

      void unSafeStatementInterceptors() throws SQLException
      Throws:
      SQLException
    • useAnsiQuotedIdentifiers

      boolean useAnsiQuotedIdentifiers()
    • getConnectionAttributes

      String getConnectionAttributes() throws SQLException
      Specified by:
      getConnectionAttributes in interface ConnectionProperties
      Throws:
      SQLException
    • getLoadBalanceSafeProxy

      @Deprecated MySQLConnection getLoadBalanceSafeProxy()
      Deprecated.
      replaced by getMultiHostSafeProxy()
    • getMultiHostSafeProxy

      MySQLConnection getMultiHostSafeProxy()
    • getActiveMySQLConnection

      MySQLConnection getActiveMySQLConnection()
    • getProfilerEventHandlerInstance

      com.mysql.jdbc.profiler.ProfilerEventHandler getProfilerEventHandlerInstance()
    • setProfilerEventHandlerInstance

      void setProfilerEventHandlerInstance(com.mysql.jdbc.profiler.ProfilerEventHandler h)
    • isServerTruncatesFracSecs

      boolean isServerTruncatesFracSecs()
    • getQueryTimingUnits

      String getQueryTimingUnits()