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 boolean
characterSetNamesMatches(java.lang.String mysqlEncodingName)
void
configureCharacterSets()
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()
java.lang.String
getCharacterSetMetadata()
java.lang.String
getCharacterSetResultsOnServer()
long
getClientParam()
java.util.TimeZone
getDefaultTimeZone()
The default time zone used to marshall date/time values to/from the server.java.lang.String
getEncodingForIndex(int collationIndex)
Returns the Java character encoding name for the given MySQL server collation indexjava.lang.String
getErrorMessageEncoding()
int
getMaxBytesPerChar(java.lang.Integer charsetIndex, java.lang.String javaCharsetName)
int
getMaxBytesPerChar(java.lang.String javaCharsetName)
int
getMetadataCollationIndex()
int
getOldStatusFlags()
java.lang.String
getServerDefaultCharset()
int
getServerDefaultCollationIndex()
java.lang.String
getServerVariable(java.lang.String name)
int
getServerVariable(java.lang.String variableName, int fallbackValue)
java.util.Map<java.lang.String,java.lang.String>
getServerVariables()
ServerVersion
getServerVersion()
Get the version of the MySQL server we are talking to.java.util.TimeZone
getSessionTimeZone()
int
getStatusFlags()
long
getThreadId()
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
setCharacterSetMetadata(java.lang.String characterSetMetadata)
void
setCharacterSetResultsOnServer(java.lang.String characterSetResultsOnServer)
void
setClientParam(long clientParam)
void
setErrorMessageEncoding(java.lang.String errorMessageEncoding)
void
setMetadataCollationIndex(int metadataCollationIndex)
void
setOldStatusFlags(int statusFlags)
void
setServerDefaultCollationIndex(int serverDefaultCollationIndex)
Stores collation index which server provided in handshake greeting packet.void
setServerVariables(java.util.Map<java.lang.String,java.lang.String> serverVariables)
void
setSessionTimeZone(java.util.TimeZone sessionTimeZone)
void
setStatusFlags(int statusFlags)
Sets new server status (from response) without saving it's old statevoid
setStatusFlags(int statusFlags, boolean saveOldStatusFlags)
Sets new server status (from response)void
setThreadId(long threadId)
boolean
storesLowerCaseTableNames()
boolean
useAnsiQuotedIdentifiers()
boolean
useMultiResults()
-
Constructor Details
-
XServerSession
public XServerSession()
-
-
Method Details
-
getCapabilities
- Specified by:
getCapabilities
in interfaceServerSession
-
setCapabilities
- Specified by:
setCapabilities
in interfaceServerSession
-
getStatusFlags
public int getStatusFlags()- Specified by:
getStatusFlags
in interfaceServerSession
-
setStatusFlags
public void setStatusFlags(int statusFlags)Description copied from interface:ServerSession
Sets new server status (from response) without saving it's old state- Specified by:
setStatusFlags
in interfaceServerSession
- Parameters:
statusFlags
- server status flags
-
setStatusFlags
public void setStatusFlags(int statusFlags, boolean saveOldStatusFlags)Description copied from interface:ServerSession
Sets new server status (from response)- Specified by:
setStatusFlags
in interfaceServerSession
- Parameters:
statusFlags
- new server status flagssaveOldStatusFlags
- true if old server status flags should be preserved
-
getOldStatusFlags
public int getOldStatusFlags()- Specified by:
getOldStatusFlags
in interfaceServerSession
-
setOldStatusFlags
public void setOldStatusFlags(int statusFlags)- Specified by:
setOldStatusFlags
in interfaceServerSession
-
getServerDefaultCollationIndex
public int getServerDefaultCollationIndex()- Specified by:
getServerDefaultCollationIndex
in interfaceServerSession
- Returns:
- Collation index which server provided in handshake greeting packet
-
setServerDefaultCollationIndex
public void setServerDefaultCollationIndex(int serverDefaultCollationIndex)Description copied from interface:ServerSession
Stores collation index which server provided in handshake greeting packet.- Specified by:
setServerDefaultCollationIndex
in interfaceServerSession
- Parameters:
serverDefaultCollationIndex
- collation index
-
getTransactionState
public int getTransactionState()- Specified by:
getTransactionState
in interfaceServerSession
- Returns:
- TRANSACTION_NOT_STARTED, TRANSACTION_IN_PROGRESS, TRANSACTION_STARTED or TRANSACTION_COMPLETED
-
inTransactionOnServer
public boolean inTransactionOnServer()- Specified by:
inTransactionOnServer
in interfaceServerSession
-
cursorExists
public boolean cursorExists()Description copied from interface:ServerSession
Server 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:
cursorExists
in interfaceServerSession
- Returns:
- SERVER_STATUS_CURSOR_EXISTS status flag value.
-
isAutocommit
public boolean isAutocommit()- Specified by:
isAutocommit
in interfaceServerSession
-
hasMoreResults
public boolean hasMoreResults()- Specified by:
hasMoreResults
in interfaceServerSession
-
isLastRowSent
public boolean isLastRowSent()- Specified by:
isLastRowSent
in interfaceServerSession
-
noGoodIndexUsed
public boolean noGoodIndexUsed()- Specified by:
noGoodIndexUsed
in interfaceServerSession
-
noIndexUsed
public boolean noIndexUsed()- Specified by:
noIndexUsed
in interfaceServerSession
-
queryWasSlow
public boolean queryWasSlow()- Specified by:
queryWasSlow
in interfaceServerSession
-
getClientParam
public long getClientParam()- Specified by:
getClientParam
in interfaceServerSession
-
setClientParam
public void setClientParam(long clientParam)- Specified by:
setClientParam
in interfaceServerSession
-
useMultiResults
public boolean useMultiResults()- Specified by:
useMultiResults
in interfaceServerSession
-
isEOFDeprecated
public boolean isEOFDeprecated()- Specified by:
isEOFDeprecated
in interfaceServerSession
-
hasLongColumnInfo
public boolean hasLongColumnInfo()- Specified by:
hasLongColumnInfo
in interfaceServerSession
-
getServerVariables
public java.util.Map<java.lang.String,java.lang.String> getServerVariables()- Specified by:
getServerVariables
in interfaceServerSession
-
getServerVariable
public java.lang.String getServerVariable(java.lang.String name)- Specified by:
getServerVariable
in interfaceServerSession
-
getServerVariable
public int getServerVariable(java.lang.String variableName, int fallbackValue)- Specified by:
getServerVariable
in interfaceServerSession
-
setServerVariables
public void setServerVariables(java.util.Map<java.lang.String,java.lang.String> serverVariables)- Specified by:
setServerVariables
in interfaceServerSession
-
characterSetNamesMatches
public boolean characterSetNamesMatches(java.lang.String mysqlEncodingName)- Specified by:
characterSetNamesMatches
in interfaceServerSession
-
getServerVersion
Description copied from interface:ServerSession
Get the version of the MySQL server we are talking to.- Specified by:
getServerVersion
in interfaceServerSession
- Returns:
ServerVersion
-
isVersion
Description copied from interface:ServerSession
Is the version of the MySQL server we are connected to the given version?- Specified by:
isVersion
in 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:
getServerDefaultCharset
in 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:
getErrorMessageEncoding
in interfaceServerSession
-
setErrorMessageEncoding
public void setErrorMessageEncoding(java.lang.String errorMessageEncoding)- Specified by:
setErrorMessageEncoding
in interfaceServerSession
-
getMaxBytesPerChar
public int getMaxBytesPerChar(java.lang.String javaCharsetName)- Specified by:
getMaxBytesPerChar
in interfaceServerSession
-
getMaxBytesPerChar
public int getMaxBytesPerChar(java.lang.Integer charsetIndex, java.lang.String javaCharsetName)- Specified by:
getMaxBytesPerChar
in interfaceServerSession
-
getEncodingForIndex
public java.lang.String getEncodingForIndex(int collationIndex)Description copied from interface:ServerSession
Returns the Java character encoding name for the given MySQL server collation index- Specified by:
getEncodingForIndex
in interfaceServerSession
- Parameters:
collationIndex
- collation index- Returns:
- the Java character encoding name for the given MySQL server collation index
-
configureCharacterSets
public void configureCharacterSets()- Specified by:
configureCharacterSets
in interfaceServerSession
-
getCharacterSetMetadata
public java.lang.String getCharacterSetMetadata()- Specified by:
getCharacterSetMetadata
in interfaceServerSession
-
setCharacterSetMetadata
public void setCharacterSetMetadata(java.lang.String characterSetMetadata)- Specified by:
setCharacterSetMetadata
in interfaceServerSession
-
getMetadataCollationIndex
public int getMetadataCollationIndex()- Specified by:
getMetadataCollationIndex
in interfaceServerSession
-
setMetadataCollationIndex
public void setMetadataCollationIndex(int metadataCollationIndex)- Specified by:
setMetadataCollationIndex
in interfaceServerSession
-
getCharacterSetResultsOnServer
public java.lang.String getCharacterSetResultsOnServer()- Specified by:
getCharacterSetResultsOnServer
in interfaceServerSession
-
setCharacterSetResultsOnServer
public void setCharacterSetResultsOnServer(java.lang.String characterSetResultsOnServer)- Specified by:
setCharacterSetResultsOnServer
in interfaceServerSession
-
isLowerCaseTableNames
public boolean isLowerCaseTableNames()Description copied from interface:ServerSession
Is the server configured to use lower-case table names only?- Specified by:
isLowerCaseTableNames
in interfaceServerSession
- Returns:
- true if lower_case_table_names is 'on'
-
storesLowerCaseTableNames
public boolean storesLowerCaseTableNames()- Specified by:
storesLowerCaseTableNames
in interfaceServerSession
-
isQueryCacheEnabled
public boolean isQueryCacheEnabled()- Specified by:
isQueryCacheEnabled
in interfaceServerSession
-
isNoBackslashEscapesSet
public boolean isNoBackslashEscapesSet()- Specified by:
isNoBackslashEscapesSet
in interfaceServerSession
-
useAnsiQuotedIdentifiers
public boolean useAnsiQuotedIdentifiers()- Specified by:
useAnsiQuotedIdentifiers
in interfaceServerSession
-
isServerTruncatesFracSecs
public boolean isServerTruncatesFracSecs()- Specified by:
isServerTruncatesFracSecs
in interfaceServerSession
-
getThreadId
public long getThreadId()- Specified by:
getThreadId
in interfaceServerSession
-
setThreadId
public void setThreadId(long threadId)- Specified by:
setThreadId
in interfaceServerSession
-
isAutoCommit
public boolean isAutoCommit()- Specified by:
isAutoCommit
in interfaceServerSession
-
setAutoCommit
public void setAutoCommit(boolean autoCommit)- Specified by:
setAutoCommit
in interfaceServerSession
-
getSessionTimeZone
public java.util.TimeZone getSessionTimeZone()- Specified by:
getSessionTimeZone
in interfaceServerSession
-
setSessionTimeZone
public void setSessionTimeZone(java.util.TimeZone sessionTimeZone)- Specified by:
setSessionTimeZone
in interfaceServerSession
-
getDefaultTimeZone
public java.util.TimeZone getDefaultTimeZone()Description copied from interface:ServerSession
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.- Specified by:
getDefaultTimeZone
in interfaceServerSession
- Returns:
- The default JVM time zone
-