接口 CharsetSettings
-
- 所有已知实现类:
NativeCharsetSettings
public interface CharsetSettings
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringCHARACTER_SET_CLIENTstatic StringCHARACTER_SET_CONNECTIONstatic StringCHARACTER_SET_RESULTSstatic StringCOLLATION_CONNECTION
-
方法概要
-
-
-
方法详细资料
-
configurePreHandshake
int configurePreHandshake(boolean reset)
Choose the MySQL collation index for the handshake packet and the corresponding Java encodings for the password and error messages.
This index will be sent with HandshakeResponse setting server variables 'character_set_connection', 'collation_connection', 'character_set_client' and 'character_set_results' which will be used by the server for decoding passwords during the authentication phase and later on, if no SET NAMES are issued by
configurePostHandshake(boolean).It also means that collation index should be set according to:
- 'passwordCharacterEncoding' if it's present, or
- 'connectionCollation' if it's present, or
- 'characterEncoding' if it's present
Since Protocol::HandshakeV10 and Protocol::HandshakeResponse41 has only one byte for the collation it's not possible to use indexes > 255 during the handshake. Also, ucs2, utf16, utf16le and utf32 character sets are impermissible here. Connector/J will try to use utf8mb4 instead.
- 参数:
reset- reset the charsets configuration; needed for changeUser call.- 返回:
- MySQL collation index to be used during the handshake.
-
configurePostHandshake
void configurePostHandshake(boolean dontCheckServerMatch)
Sets up client character set. This must be done before any further communication with the server! The 'collation_connection', 'character_set_client', 'character_set_connection' and 'character_set_results' server variables are set according to the collation index selected byconfigurePreHandshake(boolean)and sent in the Protocol::HandshakeV10 packet. Here Connector/J alters these server variables if needed.- 参数:
dontCheckServerMatch- if true then send the SET NAMES query even if server charset already matches the new value; needed for changeUser call.
-
doesPlatformDbCharsetMatches
boolean doesPlatformDbCharsetMatches()
-
getPasswordCharacterEncoding
String getPasswordCharacterEncoding()
-
getErrorMessageEncoding
String getErrorMessageEncoding()
-
getMetadataEncoding
String getMetadataEncoding()
-
getMetadataCollationIndex
int getMetadataCollationIndex()
-
getRequiresEscapingEncoder
boolean getRequiresEscapingEncoder()
-
getJavaEncodingForCollationIndex
String getJavaEncodingForCollationIndex(int collationIndex)
-
getMaxBytesPerChar
int getMaxBytesPerChar(String javaCharsetName)
-
getMysqlCharsetNameForCollationIndex
String getMysqlCharsetNameForCollationIndex(Integer collationIndex)
-
getCollationIndexForJavaEncoding
int getCollationIndexForJavaEncoding(String javaEncoding, ServerVersion version)
-
getCollationIndexForMysqlCharsetName
int getCollationIndexForMysqlCharsetName(String charsetName)
-
getMysqlCharsetForJavaEncoding
String getMysqlCharsetForJavaEncoding(String javaEncoding, ServerVersion version)
-
isMultibyteCharset
boolean isMultibyteCharset(String javaEncodingName)
-
-