Top Description Fields Methods
com.mysql.cj.protocol

public Interface ServerSession

Known Direct Implementers
com.mysql.cj.protocol.a.NativeServerSession, com.mysql.cj.protocol.x.XServerSession
Imports
java.util.Map, .TimeZone, com.mysql.cj.CharsetSettings, .ServerVersion, com.mysql.cj.exceptions.CJOperationNotSupportedException, .ExceptionFactory

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

Field Summary

Modifier and TypeField and Description
public static final int
TRANSACTION_COMPLETED

Old SERVER_STATUS_IN_TRANS state was 1 and current one is 0.

public static final int
TRANSACTION_IN_PROGRESS

There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 1.

public static final int
TRANSACTION_NOT_STARTED

There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 0.

public static final int
TRANSACTION_STARTED

Old SERVER_STATUS_IN_TRANS state was 0 and current one is 1.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

SERVER_STATUS_CURSOR_EXISTS status flag value.
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.

public ServerCapabilities
public CharsetSettings
public long
public TimeZone

Returns:

The default JVM time zone
getDefaultTimeZone
()

The default time zone used to marshal date/time values to/from the server.

public default ServerSessionStateController
public String
public int
getServerVariable(String variableName, int fallbackValue)

public Map<String, String>
public ServerVersion

Returns:

ServerVersion
getServerVersion
()

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

public TimeZone
public int
public int

Returns:

TRANSACTION_NOT_STARTED, TRANSACTION_IN_PROGRESS, TRANSACTION_STARTED or TRANSACTION_COMPLETED
getTransactionState
()

public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true if lower_case_table_names is 'on'
isLowerCaseTableNames
()

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

public boolean
public boolean
public boolean
public boolean
public boolean

Returns:

true if the version of the MySQL server we are connected is the given version
isVersion
(ServerVersion
the version to check for
version
)

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

public boolean
public boolean
public boolean
public void
setAutoCommit(boolean autoCommit)

public void
public void
public void
setClientParam(long clientParam)

public void
setServerVariables(Map<String, String> serverVariables)

public void
setSessionTimeZone(TimeZone sessionTimeZone)

public void
setStatusFlags(int
server status flags
statusFlags
)

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

public void
setStatusFlags(int
new server status flags
statusFlags
,
boolean
true if old server status flags should be preserved
saveOldStatusFlags
)

Sets new server status (from response)

public boolean
public boolean
public boolean
public boolean

Field Detail

TRANSACTION_COMPLETEDback to summary
public static final int TRANSACTION_COMPLETED

Old SERVER_STATUS_IN_TRANS state was 1 and current one is 0.

TRANSACTION_IN_PROGRESSback to summary
public static final int TRANSACTION_IN_PROGRESS

There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 1.

TRANSACTION_NOT_STARTEDback to summary
public static final int TRANSACTION_NOT_STARTED

There was no change between old and current SERVER_STATUS_IN_TRANS state and it is 0.

TRANSACTION_STARTEDback to summary
public static final int TRANSACTION_STARTED

Old SERVER_STATUS_IN_TRANS state was 0 and current one is 1.

Method Detail

cursorExistsback to summary
public 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:boolean

SERVER_STATUS_CURSOR_EXISTS status flag value.

getCapabilitiesback to summary
public ServerCapabilities getCapabilities()
getCharsetSettingsback to summary
public CharsetSettings getCharsetSettings()
getClientParamback to summary
public long getClientParam()
getDefaultTimeZoneback to summary
public 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:TimeZone

The default JVM time zone

getServerSessionStateControllerback to summary
public default ServerSessionStateController getServerSessionStateController()
getServerVariableback to summary
public String getServerVariable(String name)
getServerVariableback to summary
public int getServerVariable(String variableName, int fallbackValue)
getServerVariablesback to summary
public Map<String, String> getServerVariables()
getServerVersionback to summary
public ServerVersion getServerVersion()

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

Returns:ServerVersion

ServerVersion

getSessionTimeZoneback to summary
public TimeZone getSessionTimeZone()
getStatusFlagsback to summary
public int getStatusFlags()
getTransactionStateback to summary
public int getTransactionState()
Returns:int

TRANSACTION_NOT_STARTED, TRANSACTION_IN_PROGRESS, TRANSACTION_STARTED or TRANSACTION_COMPLETED

hasLongColumnInfoback to summary
public boolean hasLongColumnInfo()
hasMoreResultsback to summary
public boolean hasMoreResults()
inTransactionOnServerback to summary
public boolean inTransactionOnServer()
isAutocommitback to summary
public boolean isAutocommit()
isAutoCommitback to summary
public boolean isAutoCommit()
isEOFDeprecatedback to summary
public boolean isEOFDeprecated()
isLastRowSentback to summary
public boolean isLastRowSent()
isLowerCaseTableNamesback to summary
public boolean isLowerCaseTableNames()

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

Returns:boolean

true if lower_case_table_names is 'on'

isNoBackslashEscapesSetback to summary
public boolean isNoBackslashEscapesSet()
isQueryCacheEnabledback to summary
public boolean isQueryCacheEnabled()
isServerTruncatesFracSecsback to summary
public boolean isServerTruncatesFracSecs()
isSessionStateTrackingEnabledback to summary
public boolean isSessionStateTrackingEnabled()
isVersionback to summary
public boolean isVersion(ServerVersion version)

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

Parameters
version:ServerVersion

the version to check for

Returns:boolean

true if the version of the MySQL server we are connected is the given version

noGoodIndexUsedback to summary
public boolean noGoodIndexUsed()
noIndexUsedback to summary
public boolean noIndexUsed()
queryWasSlowback to summary
public boolean queryWasSlow()
setAutoCommitback to summary
public void setAutoCommit(boolean autoCommit)
setCapabilitiesback to summary
public void setCapabilities(ServerCapabilities capabilities)
setCharsetSettingsback to summary
public void setCharsetSettings(CharsetSettings charsetSettings)
setClientParamback to summary
public void setClientParam(long clientParam)
setServerVariablesback to summary
public void setServerVariables(Map<String, String> serverVariables)
setSessionTimeZoneback to summary
public void setSessionTimeZone(TimeZone sessionTimeZone)
setStatusFlagsback to summary
public void setStatusFlags(int statusFlags)

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

Parameters
statusFlags:int

server status flags

setStatusFlagsback to summary
public void setStatusFlags(int statusFlags, boolean saveOldStatusFlags)

Sets new server status (from response)

Parameters
statusFlags:int

new server status flags

saveOldStatusFlags:boolean

true if old server status flags should be preserved

storesLowerCaseTableNamesback to summary
public boolean storesLowerCaseTableNames()
supportsQueryAttributesback to summary
public boolean supportsQueryAttributes()
useAnsiQuotedIdentifiersback to summary
public boolean useAnsiQuotedIdentifiers()
useMultiResultsback to summary
public boolean useMultiResults()