public interface CharsetSettings
| Modifier and Type | Field and Description |
|---|---|
static String |
CHARACTER_SET_CLIENT |
static String |
CHARACTER_SET_CONNECTION |
static String |
CHARACTER_SET_RESULTS |
static String |
COLLATION_CONNECTION |
static final String CHARACTER_SET_CLIENT
static final String CHARACTER_SET_CONNECTION
static final String CHARACTER_SET_RESULTS
static final String COLLATION_CONNECTION
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:
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.void configurePostHandshake(boolean dontCheckServerMatch)
configurePreHandshake(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.boolean doesPlatformDbCharsetMatches()
String getPasswordCharacterEncoding()
String getErrorMessageEncoding()
String getMetadataEncoding()
int getMetadataCollationIndex()
boolean getRequiresEscapingEncoder()
String getJavaEncodingForCollationIndex(int collationIndex)
int getMaxBytesPerChar(String javaCharsetName)
String getMysqlCharsetNameForCollationIndex(Integer collationIndex)
int getCollationIndexForJavaEncoding(String javaEncoding, ServerVersion version)
int getCollationIndexForMysqlCharsetName(String charsetName)
String getMysqlCharsetForJavaEncoding(String javaEncoding, ServerVersion version)
boolean isMultibyteCharset(String javaEncodingName)