接口 ServerSession

  • 所有已知实现类:
    NativeServerSession

    public interface ServerSession
    Keeps the effective states of server/session variables, contains methods for initial retrieving of these states and for their actualization.
    • 字段详细资料

      • TRANSACTION_NOT_STARTED

        static final int TRANSACTION_NOT_STARTED
        There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 0.
        另请参阅:
        常量字段值
      • TRANSACTION_IN_PROGRESS

        static final int TRANSACTION_IN_PROGRESS
        There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 1.
        另请参阅:
        常量字段值
      • TRANSACTION_STARTED

        static final int TRANSACTION_STARTED
        Old SERVER_STATUS_IN_TRANS state was 0 and current one is 1.
        另请参阅:
        常量字段值
      • TRANSACTION_COMPLETED

        static final int TRANSACTION_COMPLETED
        Old SERVER_STATUS_IN_TRANS state was 1 and current one is 0.
        另请参阅:
        常量字段值
      • LOCAL_CHARACTER_SET_RESULTS

        static final String LOCAL_CHARACTER_SET_RESULTS
        另请参阅:
        常量字段值
    • 方法详细资料

      • getStatusFlags

        int getStatusFlags()
      • setStatusFlags

        void setStatusFlags​(int statusFlags)
        Sets new server status (from response) without saving it's old state
        参数:
        statusFlags - server status flags
      • setStatusFlags

        void setStatusFlags​(int statusFlags,
                            boolean saveOldStatusFlags)
        Sets new server status (from response)
        参数:
        statusFlags - new server status flags
        saveOldStatusFlags - true if old server status flags should be preserved
      • getOldStatusFlags

        int getOldStatusFlags()
      • setOldStatusFlags

        void setOldStatusFlags​(int statusFlags)
      • getServerDefaultCollationIndex

        int getServerDefaultCollationIndex()
        返回:
        Collation index which server provided in handshake greeting packet
      • setServerDefaultCollationIndex

        void setServerDefaultCollationIndex​(int serverDefaultCollationIndex)
        Stores collation index which server provided in handshake greeting packet.
        参数:
        serverDefaultCollationIndex - collation index
      • getTransactionState

        int getTransactionState()
        返回:
        TRANSACTION_NOT_STARTED, TRANSACTION_IN_PROGRESS, TRANSACTION_STARTED or TRANSACTION_COMPLETED
      • inTransactionOnServer

        boolean inTransactionOnServer()
      • cursorExists

        boolean cursorExists()
        Server will only open a cursor and set this flag if it can, otherwise it punts and goes back to mysql_store_results() behavior.
        返回:
        SERVER_STATUS_CURSOR_EXISTS status flag value.
      • isAutocommit

        boolean isAutocommit()
      • hasMoreResults

        boolean hasMoreResults()
      • isLastRowSent

        boolean isLastRowSent()
      • noGoodIndexUsed

        boolean noGoodIndexUsed()
      • noIndexUsed

        boolean noIndexUsed()
      • queryWasSlow

        boolean queryWasSlow()
      • getClientParam

        long getClientParam()
      • setClientParam

        void setClientParam​(long clientParam)
      • useMultiResults

        boolean useMultiResults()
      • isEOFDeprecated

        boolean isEOFDeprecated()
      • hasLongColumnInfo

        boolean hasLongColumnInfo()
      • setHasLongColumnInfo

        void setHasLongColumnInfo​(boolean hasLongColumnInfo)
        Does the server send back extra column info?
        参数:
        hasLongColumnInfo - flag
      • getServerVariable

        String getServerVariable​(String name)
      • getServerVariable

        int getServerVariable​(String variableName,
                              int fallbackValue)
      • setServerVariables

        void setServerVariables​(Map<String,​String> serverVariables)
      • characterSetNamesMatches

        boolean characterSetNamesMatches​(String mysqlEncodingName)
      • isVersion

        boolean isVersion​(ServerVersion version)
        Is the version of the MySQL server we are connected to the given version?
        参数:
        version - the version to check for
        返回:
        true if the version of the MySQL server we are connected is the given version
      • getServerDefaultCharset

        String getServerDefaultCharset()
        返回:
        the server's default character set name according to collation index from server greeting, or value of 'character_set_server' variable if there is no mapping for that index
      • getErrorMessageEncoding

        String getErrorMessageEncoding()
      • setErrorMessageEncoding

        void setErrorMessageEncoding​(String errorMessageEncoding)
      • getMaxBytesPerChar

        int getMaxBytesPerChar​(String javaCharsetName)
      • getMaxBytesPerChar

        int getMaxBytesPerChar​(Integer charsetIndex,
                               String javaCharsetName)
      • getEncodingForIndex

        String getEncodingForIndex​(int collationIndex)
        Returns the Java character encoding name for the given MySQL server collation index
        参数:
        collationIndex - collation index
        返回:
        the Java character encoding name for the given MySQL server collation index
      • configureCharacterSets

        void configureCharacterSets()
      • getCharacterSetMetadata

        String getCharacterSetMetadata()
      • setCharacterSetMetadata

        void setCharacterSetMetadata​(String characterSetMetadata)
      • getMetadataCollationIndex

        int getMetadataCollationIndex()
      • setMetadataCollationIndex

        void setMetadataCollationIndex​(int metadataCollationIndex)
      • getCharacterSetResultsOnServer

        String getCharacterSetResultsOnServer()
      • setCharacterSetResultsOnServer

        void setCharacterSetResultsOnServer​(String characterSetResultsOnServer)
      • isLowerCaseTableNames

        boolean isLowerCaseTableNames()
        Is the server configured to use lower-case table names only?
        返回:
        true if lower_case_table_names is 'on'
      • storesLowerCaseTableNames

        boolean storesLowerCaseTableNames()
      • isQueryCacheEnabled

        boolean isQueryCacheEnabled()
      • isNoBackslashEscapesSet

        boolean isNoBackslashEscapesSet()
      • useAnsiQuotedIdentifiers

        boolean useAnsiQuotedIdentifiers()
      • isServerTruncatesFracSecs

        boolean isServerTruncatesFracSecs()
      • getThreadId

        long getThreadId()
      • setThreadId

        void setThreadId​(long threadId)
      • isAutoCommit

        boolean isAutoCommit()
      • setAutoCommit

        void setAutoCommit​(boolean autoCommit)
      • getServerTimeZone

        TimeZone getServerTimeZone()
      • setServerTimeZone

        void setServerTimeZone​(TimeZone serverTimeZone)
      • getDefaultTimeZone

        TimeZone getDefaultTimeZone()
        The default time zone used to marshall date/time values to/from the server. This is used when getDate(), etc methods are called without a calendar argument.
        返回:
        The server time zone (which may be user overridden in a connection property)
      • setDefaultTimeZone

        void setDefaultTimeZone​(TimeZone defaultTimeZone)