com.mysql.cj.protocol

## Interface ServerSession

    public interface ServerSession

Keeps the effective states of server/session variables, contains methods for initial retrieving of these states and for their actualization.

### Field Summary

Fields
`static int` `TRANSACTION_COMPLETED` Old SERVER_STATUS_IN_TRANS state was 1 and current one is 0.
`static int` `TRANSACTION_IN_PROGRESS` There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 1.
`static int` `TRANSACTION_NOT_STARTED` There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 0.
`static int` `TRANSACTION_STARTED` Old SERVER_STATUS_IN_TRANS state was 0 and current one is 1.

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`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.
`ServerCapabilities` `getCapabilities()`
`CharsetSettings` `getCharsetSettings()`
`long` `getClientParam()`
`TimeZone` `getDefaultTimeZone()` The default time zone used to marshal date/time values to/from the server.
`int` `getOldStatusFlags()`
`default ServerSessionStateController` `getServerSessionStateController()`
`String` `getServerVariable(String name)`
`int` `getServerVariable(String variableName, int fallbackValue)`
`Map<String,String>` `getServerVariables()`
`ServerVersion` `getServerVersion()` Get the version of the MySQL server we are talking to.
`TimeZone` `getSessionTimeZone()`
`int` `getStatusFlags()`
`int` `getTransactionState()`
`boolean` `hasLongColumnInfo()`
`boolean` `hasMoreResults()`
`boolean` `inTransactionOnServer()`
`boolean` `isAutocommit()`
`boolean` `isAutoCommit()`
`boolean` `isEOFDeprecated()`
`boolean` `isLastRowSent()`
`boolean` `isLowerCaseTableNames()` Is the server configured to use lower-case table names only?
`boolean` `isNoBackslashEscapesSet()`
`boolean` `isQueryCacheEnabled()`
`boolean` `isServerTruncatesFracSecs()`
`boolean` `isVersion(ServerVersion version)` Is the version of the MySQL server we are connected to the given version?
`boolean` `noGoodIndexUsed()`
`boolean` `noIndexUsed()`
`boolean` `queryWasSlow()`
`void` `setAutoCommit(boolean autoCommit)`
`void` `setCapabilities(ServerCapabilities capabilities)`
`void` `setCharsetSettings(CharsetSettings charsetSettings)`
`void` `setClientParam(long clientParam)`
`void` `setOldStatusFlags(int statusFlags)`
`void` `setServerVariables(Map<String,String> serverVariables)`
`void` `setSessionTimeZone(TimeZone sessionTimeZone)`
`void` `setStatusFlags(int statusFlags)` Sets new server status (from response) without saving it's old state
`void` `setStatusFlags(int statusFlags, boolean saveOldStatusFlags)` Sets new server status (from response)
`boolean` `storesLowerCaseTableNames()`
`boolean` `supportsQueryAttributes()`
`boolean` `useAnsiQuotedIdentifiers()`
`boolean` `useMultiResults()`

### Field Detail

#### 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.

See Also:
  Constant Field Values

#### 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.

See Also:
  Constant Field Values

#### TRANSACTION_STARTED

    static final int TRANSACTION_STARTED

Old SERVER_STATUS_IN_TRANS state was 0 and current one is 1.

See Also:
  Constant Field Values

#### TRANSACTION_COMPLETED

    static final int TRANSACTION_COMPLETED

Old SERVER_STATUS_IN_TRANS state was 1 and current one is 0.

See Also:
  Constant Field Values

### Method Detail

#### getCapabilities

    ServerCapabilities getCapabilities()

#### setCapabilities

    void setCapabilities(ServerCapabilities capabilities)

#### getStatusFlags

    int getStatusFlags()

#### setStatusFlags

    void setStatusFlags(int statusFlags)

Sets new server status (from response) without saving it's old state

Parameters:
  `statusFlags` - server status flags

#### setStatusFlags

    void setStatusFlags(int statusFlags,
                        boolean saveOldStatusFlags)

Sets new server status (from response)

Parameters:
  `statusFlags` - new server status flags
  `saveOldStatusFlags` - true if old server status flags should be preserved

#### getOldStatusFlags

    int getOldStatusFlags()

#### setOldStatusFlags

    void setOldStatusFlags(int statusFlags)

#### getTransactionState

    int getTransactionState()

Returns:
  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.

Returns:
  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)

#### hasLongColumnInfo

    boolean hasLongColumnInfo()

#### useMultiResults

    boolean useMultiResults()

#### isEOFDeprecated

    boolean isEOFDeprecated()

#### supportsQueryAttributes

    boolean supportsQueryAttributes()

#### getServerVariables

    Map<String,String> getServerVariables()

#### getServerVariable

    String getServerVariable(String name)

#### getServerVariable

    int getServerVariable(String variableName,
                          int fallbackValue)

#### setServerVariables

    void setServerVariables(Map<String,String> serverVariables)

#### getServerVersion

    ServerVersion getServerVersion()

Get the version of the MySQL server we are talking to.

Returns:
  `ServerVersion`

#### isVersion

    boolean isVersion(ServerVersion version)

Is the version of the MySQL server we are connected to the given version?

Parameters:
  `version` - the version to check for
Returns:
  true if the version of the MySQL server we are connected is the given version

#### isLowerCaseTableNames

    boolean isLowerCaseTableNames()

Is the server configured to use lower-case table names only?

Returns:
  true if lower_case_table_names is 'on'

#### storesLowerCaseTableNames

    boolean storesLowerCaseTableNames()

#### isQueryCacheEnabled

    boolean isQueryCacheEnabled()

#### isNoBackslashEscapesSet

    boolean isNoBackslashEscapesSet()

#### useAnsiQuotedIdentifiers

    boolean useAnsiQuotedIdentifiers()

#### isServerTruncatesFracSecs

    boolean isServerTruncatesFracSecs()

#### isAutoCommit

    boolean isAutoCommit()

#### setAutoCommit

    void setAutoCommit(boolean autoCommit)

#### getSessionTimeZone

    TimeZone getSessionTimeZone()

#### setSessionTimeZone

    void setSessionTimeZone(TimeZone sessionTimeZone)

#### getDefaultTimeZone

    TimeZone getDefaultTimeZone()

The default time zone used to marshal date/time values to/from the server. This is used when methods like getDate() are called without a calendar argument.

Returns:
  The default JVM time zone

#### getServerSessionStateController

    default ServerSessionStateController getServerSessionStateController()

#### getCharsetSettings

    CharsetSettings getCharsetSettings()

#### setCharsetSettings

    void setCharsetSettings(CharsetSettings charsetSettings)

Copyright © 2016, 2023, Oracle and/or its affiliates.