接口 ServerSession
-
- 所有已知实现类:
NativeServerSession
public interface ServerSessionKeeps the effective states of server/session variables, contains methods for initial retrieving of these states and for their actualization.
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringLOCAL_CHARACTER_SET_RESULTSstatic intTRANSACTION_COMPLETEDOld SERVER_STATUS_IN_TRANS state was 1 and current one is 0.static intTRANSACTION_IN_PROGRESSThere was no change between old and current SERVER_STATUS_IN_TRANS state and it is 1.static intTRANSACTION_NOT_STARTEDThere was no change between old and current SERVER_STATUS_IN_TRANS state and it is 0.static intTRANSACTION_STARTEDOld SERVER_STATUS_IN_TRANS state was 0 and current one is 1.
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 booleancharacterSetNamesMatches(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()StringgetCharacterSetMetadata()StringgetCharacterSetResultsOnServer()longgetClientParam()TimeZonegetDefaultTimeZone()The default time zone used to marshall date/time values to/from the server.StringgetEncodingForIndex(int collationIndex)Returns the Java character encoding name for the given MySQL server collation indexStringgetErrorMessageEncoding()intgetMaxBytesPerChar(Integer charsetIndex, String javaCharsetName)intgetMaxBytesPerChar(String javaCharsetName)intgetMetadataCollationIndex()intgetOldStatusFlags()StringgetServerDefaultCharset()intgetServerDefaultCollationIndex()TimeZonegetServerTimeZone()StringgetServerVariable(String name)intgetServerVariable(String variableName, int fallbackValue)Map<String,String>getServerVariables()ServerVersiongetServerVersion()Get the version of the MySQL server we are talking to.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(String characterSetMetadata)voidsetCharacterSetResultsOnServer(String characterSetResultsOnServer)voidsetClientParam(long clientParam)voidsetDefaultTimeZone(TimeZone defaultTimeZone)voidsetErrorMessageEncoding(String errorMessageEncoding)voidsetHasLongColumnInfo(boolean hasLongColumnInfo)Does the server send back extra column info?voidsetMetadataCollationIndex(int metadataCollationIndex)voidsetOldStatusFlags(int statusFlags)voidsetServerDefaultCollationIndex(int serverDefaultCollationIndex)Stores collation index which server provided in handshake greeting packet.voidsetServerTimeZone(TimeZone serverTimeZone)voidsetServerVariables(Map<String,String> serverVariables)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()
-
-
-
字段详细资料
-
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.- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
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- 参数:
statusFlags- server status flags
-
setStatusFlags
void setStatusFlags(int statusFlags, boolean saveOldStatusFlags)Sets new server status (from response)- 参数:
statusFlags- new server status flagssaveOldStatusFlags- 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
int getServerVariable(String variableName, int fallbackValue)
-
characterSetNamesMatches
boolean characterSetNamesMatches(String mysqlEncodingName)
-
getServerVersion
ServerVersion getServerVersion()
Get the version of the MySQL server we are talking to.- 返回:
ServerVersion
-
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)
-
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)
-
-