Package com.mysql.cj.protocol.x
Class XServerSession
java.lang.Object
com.mysql.cj.protocol.x.XServerSession
- All Implemented Interfaces:
ServerSession
public class XServerSession extends java.lang.Object implements ServerSession
-
Field Summary
Fields inherited from interface com.mysql.cj.protocol.ServerSession
LOCAL_CHARACTER_SET_RESULTS, TRANSACTION_COMPLETED, TRANSACTION_IN_PROGRESS, TRANSACTION_NOT_STARTED, TRANSACTION_STARTED -
Constructor Summary
Constructors Constructor Description XServerSession() -
Method Summary
Modifier and Type Method Description booleancharacterSetNamesMatches(java.lang.String mysqlEncodingName)voidconfigureCharacterSets()booleancursorExists()Server will only open a cursor and set this flag if it can, otherwise it punts and goes back to mysql_store_results() behavior.ServerCapabilitiesgetCapabilities()java.lang.StringgetCharacterSetMetadata()java.lang.StringgetCharacterSetResultsOnServer()longgetClientParam()java.util.TimeZonegetDefaultTimeZone()The default time zone used to marshall date/time values to/from the server.java.lang.StringgetEncodingForIndex(int collationIndex)Returns the Java character encoding name for the given MySQL server collation indexjava.lang.StringgetErrorMessageEncoding()intgetMaxBytesPerChar(java.lang.Integer charsetIndex, java.lang.String javaCharsetName)intgetMaxBytesPerChar(java.lang.String javaCharsetName)intgetMetadataCollationIndex()intgetOldStatusFlags()java.lang.StringgetServerDefaultCharset()intgetServerDefaultCollationIndex()java.lang.StringgetServerVariable(java.lang.String name)intgetServerVariable(java.lang.String variableName, int fallbackValue)java.util.Map<java.lang.String,java.lang.String>getServerVariables()ServerVersiongetServerVersion()Get the version of the MySQL server we are talking to.java.util.TimeZonegetSessionTimeZone()intgetStatusFlags()longgetThreadId()intgetTransactionState()booleanhasLongColumnInfo()booleanhasMoreResults()booleaninTransactionOnServer()booleanisAutocommit()booleanisAutoCommit()booleanisEOFDeprecated()booleanisLastRowSent()booleanisLowerCaseTableNames()Is the server configured to use lower-case table names only?booleanisNoBackslashEscapesSet()booleanisQueryCacheEnabled()booleanisServerTruncatesFracSecs()booleanisVersion(ServerVersion version)Is the version of the MySQL server we are connected to the given version?booleannoGoodIndexUsed()booleannoIndexUsed()booleanqueryWasSlow()voidsetAutoCommit(boolean autoCommit)voidsetCapabilities(ServerCapabilities capabilities)voidsetCharacterSetMetadata(java.lang.String characterSetMetadata)voidsetCharacterSetResultsOnServer(java.lang.String characterSetResultsOnServer)voidsetClientParam(long clientParam)voidsetErrorMessageEncoding(java.lang.String errorMessageEncoding)voidsetMetadataCollationIndex(int metadataCollationIndex)voidsetOldStatusFlags(int statusFlags)voidsetServerDefaultCollationIndex(int serverDefaultCollationIndex)Stores collation index which server provided in handshake greeting packet.voidsetServerVariables(java.util.Map<java.lang.String,java.lang.String> serverVariables)voidsetSessionTimeZone(java.util.TimeZone sessionTimeZone)voidsetStatusFlags(int statusFlags)Sets new server status (from response) without saving it's old statevoidsetStatusFlags(int statusFlags, boolean saveOldStatusFlags)Sets new server status (from response)voidsetThreadId(long threadId)booleanstoresLowerCaseTableNames()booleanuseAnsiQuotedIdentifiers()booleanuseMultiResults()
-
Constructor Details
-
XServerSession
public XServerSession()
-
-
Method Details
-
getCapabilities
- Specified by:
getCapabilitiesin interfaceServerSession
-
setCapabilities
- Specified by:
setCapabilitiesin interfaceServerSession
-
getStatusFlags
public int getStatusFlags()- Specified by:
getStatusFlagsin interfaceServerSession
-
setStatusFlags
public void setStatusFlags(int statusFlags)Description copied from interface:ServerSessionSets new server status (from response) without saving it's old state- Specified by:
setStatusFlagsin interfaceServerSession- Parameters:
statusFlags- server status flags
-
setStatusFlags
public void setStatusFlags(int statusFlags, boolean saveOldStatusFlags)Description copied from interface:ServerSessionSets new server status (from response)- Specified by:
setStatusFlagsin interfaceServerSession- Parameters:
statusFlags- new server status flagssaveOldStatusFlags- true if old server status flags should be preserved
-
getOldStatusFlags
public int getOldStatusFlags()- Specified by:
getOldStatusFlagsin interfaceServerSession
-
setOldStatusFlags
public void setOldStatusFlags(int statusFlags)- Specified by:
setOldStatusFlagsin interfaceServerSession
-
getServerDefaultCollationIndex
public int getServerDefaultCollationIndex()- Specified by:
getServerDefaultCollationIndexin interfaceServerSession- Returns:
- Collation index which server provided in handshake greeting packet
-
setServerDefaultCollationIndex
public void setServerDefaultCollationIndex(int serverDefaultCollationIndex)Description copied from interface:ServerSessionStores collation index which server provided in handshake greeting packet.- Specified by:
setServerDefaultCollationIndexin interfaceServerSession- Parameters:
serverDefaultCollationIndex- collation index
-
getTransactionState
public int getTransactionState()- Specified by:
getTransactionStatein interfaceServerSession- Returns:
- TRANSACTION_NOT_STARTED, TRANSACTION_IN_PROGRESS, TRANSACTION_STARTED or TRANSACTION_COMPLETED
-
inTransactionOnServer
public boolean inTransactionOnServer()- Specified by:
inTransactionOnServerin interfaceServerSession
-
cursorExists
public boolean cursorExists()Description copied from interface:ServerSessionServer will only open a cursor and set this flag if it can, otherwise it punts and goes back to mysql_store_results() behavior.- Specified by:
cursorExistsin interfaceServerSession- Returns:
- SERVER_STATUS_CURSOR_EXISTS status flag value.
-
isAutocommit
public boolean isAutocommit()- Specified by:
isAutocommitin interfaceServerSession
-
hasMoreResults
public boolean hasMoreResults()- Specified by:
hasMoreResultsin interfaceServerSession
-
isLastRowSent
public boolean isLastRowSent()- Specified by:
isLastRowSentin interfaceServerSession
-
noGoodIndexUsed
public boolean noGoodIndexUsed()- Specified by:
noGoodIndexUsedin interfaceServerSession
-
noIndexUsed
public boolean noIndexUsed()- Specified by:
noIndexUsedin interfaceServerSession
-
queryWasSlow
public boolean queryWasSlow()- Specified by:
queryWasSlowin interfaceServerSession
-
getClientParam
public long getClientParam()- Specified by:
getClientParamin interfaceServerSession
-
setClientParam
public void setClientParam(long clientParam)- Specified by:
setClientParamin interfaceServerSession
-
useMultiResults
public boolean useMultiResults()- Specified by:
useMultiResultsin interfaceServerSession
-
isEOFDeprecated
public boolean isEOFDeprecated()- Specified by:
isEOFDeprecatedin interfaceServerSession
-
hasLongColumnInfo
public boolean hasLongColumnInfo()- Specified by:
hasLongColumnInfoin interfaceServerSession
-
getServerVariables
public java.util.Map<java.lang.String,java.lang.String> getServerVariables()- Specified by:
getServerVariablesin interfaceServerSession
-
getServerVariable
public java.lang.String getServerVariable(java.lang.String name)- Specified by:
getServerVariablein interfaceServerSession
-
getServerVariable
public int getServerVariable(java.lang.String variableName, int fallbackValue)- Specified by:
getServerVariablein interfaceServerSession
-
setServerVariables
public void setServerVariables(java.util.Map<java.lang.String,java.lang.String> serverVariables)- Specified by:
setServerVariablesin interfaceServerSession
-
characterSetNamesMatches
public boolean characterSetNamesMatches(java.lang.String mysqlEncodingName)- Specified by:
characterSetNamesMatchesin interfaceServerSession
-
getServerVersion
Description copied from interface:ServerSessionGet the version of the MySQL server we are talking to.- Specified by:
getServerVersionin interfaceServerSession- Returns:
ServerVersion
-
isVersion
Description copied from interface:ServerSessionIs the version of the MySQL server we are connected to the given version?- Specified by:
isVersionin interfaceServerSession- Parameters:
version- the version to check for- Returns:
- true if the version of the MySQL server we are connected is the given version
-
getServerDefaultCharset
public java.lang.String getServerDefaultCharset()- Specified by:
getServerDefaultCharsetin interfaceServerSession- Returns:
- 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
public java.lang.String getErrorMessageEncoding()- Specified by:
getErrorMessageEncodingin interfaceServerSession
-
setErrorMessageEncoding
public void setErrorMessageEncoding(java.lang.String errorMessageEncoding)- Specified by:
setErrorMessageEncodingin interfaceServerSession
-
getMaxBytesPerChar
public int getMaxBytesPerChar(java.lang.String javaCharsetName)- Specified by:
getMaxBytesPerCharin interfaceServerSession
-
getMaxBytesPerChar
public int getMaxBytesPerChar(java.lang.Integer charsetIndex, java.lang.String javaCharsetName)- Specified by:
getMaxBytesPerCharin interfaceServerSession
-
getEncodingForIndex
public java.lang.String getEncodingForIndex(int collationIndex)Description copied from interface:ServerSessionReturns the Java character encoding name for the given MySQL server collation index- Specified by:
getEncodingForIndexin interfaceServerSession- Parameters:
collationIndex- collation index- Returns:
- the Java character encoding name for the given MySQL server collation index
-
configureCharacterSets
public void configureCharacterSets()- Specified by:
configureCharacterSetsin interfaceServerSession
-
getCharacterSetMetadata
public java.lang.String getCharacterSetMetadata()- Specified by:
getCharacterSetMetadatain interfaceServerSession
-
setCharacterSetMetadata
public void setCharacterSetMetadata(java.lang.String characterSetMetadata)- Specified by:
setCharacterSetMetadatain interfaceServerSession
-
getMetadataCollationIndex
public int getMetadataCollationIndex()- Specified by:
getMetadataCollationIndexin interfaceServerSession
-
setMetadataCollationIndex
public void setMetadataCollationIndex(int metadataCollationIndex)- Specified by:
setMetadataCollationIndexin interfaceServerSession
-
getCharacterSetResultsOnServer
public java.lang.String getCharacterSetResultsOnServer()- Specified by:
getCharacterSetResultsOnServerin interfaceServerSession
-
setCharacterSetResultsOnServer
public void setCharacterSetResultsOnServer(java.lang.String characterSetResultsOnServer)- Specified by:
setCharacterSetResultsOnServerin interfaceServerSession
-
isLowerCaseTableNames
public boolean isLowerCaseTableNames()Description copied from interface:ServerSessionIs the server configured to use lower-case table names only?- Specified by:
isLowerCaseTableNamesin interfaceServerSession- Returns:
- true if lower_case_table_names is 'on'
-
storesLowerCaseTableNames
public boolean storesLowerCaseTableNames()- Specified by:
storesLowerCaseTableNamesin interfaceServerSession
-
isQueryCacheEnabled
public boolean isQueryCacheEnabled()- Specified by:
isQueryCacheEnabledin interfaceServerSession
-
isNoBackslashEscapesSet
public boolean isNoBackslashEscapesSet()- Specified by:
isNoBackslashEscapesSetin interfaceServerSession
-
useAnsiQuotedIdentifiers
public boolean useAnsiQuotedIdentifiers()- Specified by:
useAnsiQuotedIdentifiersin interfaceServerSession
-
isServerTruncatesFracSecs
public boolean isServerTruncatesFracSecs()- Specified by:
isServerTruncatesFracSecsin interfaceServerSession
-
getThreadId
public long getThreadId()- Specified by:
getThreadIdin interfaceServerSession
-
setThreadId
public void setThreadId(long threadId)- Specified by:
setThreadIdin interfaceServerSession
-
isAutoCommit
public boolean isAutoCommit()- Specified by:
isAutoCommitin interfaceServerSession
-
setAutoCommit
public void setAutoCommit(boolean autoCommit)- Specified by:
setAutoCommitin interfaceServerSession
-
getSessionTimeZone
public java.util.TimeZone getSessionTimeZone()- Specified by:
getSessionTimeZonein interfaceServerSession
-
setSessionTimeZone
public void setSessionTimeZone(java.util.TimeZone sessionTimeZone)- Specified by:
setSessionTimeZonein interfaceServerSession
-
getDefaultTimeZone
public java.util.TimeZone getDefaultTimeZone()Description copied from interface:ServerSessionThe 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.- Specified by:
getDefaultTimeZonein interfaceServerSession- Returns:
- The default JVM time zone
-