| Modifier and Type | Field and Description |
|---|---|
| protected RuntimeProperty | |
| protected RuntimeProperty | |
| protected RuntimeProperty | |
| public Map | |
| public Map | |
| public Map | |
| public Map | |
| public Map | |
| public Map | |
| private NativeMessageBuilder | |
| protected RuntimeProperty | |
| private static final Map | |
| private static final Map | |
| private static final Map | customCharsetNameToMblenByUrl
Actual mysql charset name to mblen map of user defined charsets for given server URLs. |
| private static final Map | customCollationIndexToCharsetNameByUrl
Actual collation index to mysql charset name map of user defined charsets for given server URLs. |
| private static final Map | |
| private static final Map | |
| private static final Map | |
| private static final Map | |
| private String | errorMessageEncoding
The (Java) encoding used to interpret error messages received from the server. |
| public Map | |
| private int | |
| private String | metadataEncoding
What character set is the metadata returned in? |
| public Set | |
| protected RuntimeProperty | |
| private boolean | platformDbCharsetMatches
Does the character set of this connection match the character set of the platform |
| private boolean | requiresEscapingEncoder
If a CharsetEncoder is required for escaping. |
| private ServerSession | |
| private NativeSession | |
| private Integer |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | buildCollationMapping()
Builds the map needed for 4.1.0 and newer servers that maps field-level charset/collation info to a java character encoding name. |
| private boolean | |
| private void | |
| public void | configurePostHandshake(boolean
if true then send the SET NAMES query even if server charset already matches the new value; needed for changeUser call. dontCheckServerMatch)Implements com. Sets up client character set. |
| public int | configurePreHandshake(boolean
reset the charsets configuration; needed for changeUser and resetServerState call. reset)Implements com. Choose the MySQL collation index for the handshake packet and the corresponding Java encodings for the password and error messages. |
| public boolean | |
| public Integer | getCollationIndexForCollationName(String collationName)
Implements com.
|
| public int | getCollationIndexForJavaEncoding(String javaEncoding, ServerVersion version)
Implements com.
|
| public int | |
| public String | getCollationNameForCollationIndex(Integer collationIndex)
Implements com.
|
| private NativeMessageBuilder | |
| public String | |
| public String | getJavaEncodingForCollationIndex(int collationIndex)
Implements com.
|
| public String | |
| public String | getJavaEncodingForMysqlCharset(String mysqlCharsetName)
Implements com.
|
| public String | |
| public int | getMaxBytesPerChar(String javaCharsetName)
Implements com.
|
| public int | getMaxBytesPerChar(Integer charsetIndex, String javaCharsetName)
Implements com.
|
| public int | |
| public String | |
| public String | getMysqlCharsetForJavaEncoding(String javaEncoding, ServerVersion version)
Implements com.
|
| public String | getMysqlCharsetNameForCollationIndex(Integer collationIndex)
Implements com.
|
| public String | |
| public boolean | |
| public String | Returns: MySQL charset nameGet 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 |
| public boolean | |
| public boolean | isMultibyteCharset(String javaEncodingName)
Implements com.
|
| private void | |
| private void | tryAndFixEncoding(RuntimeProperty<String>
connection property containing the Java encoding to try encodingProperty, boolean The character_set_client system variable cannot be set to ucs2, utf16, utf16le, utf32 charsets. If "true" the corresponding connection
property value will be replaced with "UTF-8" replaceImpermissibleEncodings)Attempt to use the encoding, and bail out if it can't be used. |
| cacheServerConfiguration | back to summary |
|---|---|
| protected RuntimeProperty<Boolean> cacheServerConfiguration | |
| characterEncoding | back to summary |
|---|---|
| protected RuntimeProperty<String> characterEncoding | |
| characterSetResults | back to summary |
|---|---|
| protected RuntimeProperty<String> characterSetResults | |
| charsetNameToCollationIndex | back to summary |
|---|---|
| public Map<String, Integer> charsetNameToCollationIndex | |
| charsetNameToJavaEncoding | back to summary |
|---|---|
| public Map<String, String> charsetNameToJavaEncoding | |
| charsetNameToMblen | back to summary |
|---|---|
| public Map<String, Integer> charsetNameToMblen | |
| collationIndexToCharsetName | back to summary |
|---|---|
| public Map<Integer, String> collationIndexToCharsetName | |
| collationIndexToCollationName | back to summary |
|---|---|
| public Map<Integer, String> collationIndexToCollationName | |
| collationNameToCollationIndex | back to summary |
|---|---|
| public Map<String, Integer> collationNameToCollationIndex | |
| commandBuilder | back to summary |
|---|---|
| private NativeMessageBuilder commandBuilder | |
| connectionCollation | back to summary |
|---|---|
| protected RuntimeProperty<String> connectionCollation | |
| customCharsetNameToCollationIndexByUrl | back to summary |
|---|---|
| private static final Map<String, Map<String, Integer>> customCharsetNameToCollationIndexByUrl | |
| customCharsetNameToJavaEncodingByUrl | back to summary |
|---|---|
| private static final Map<String, Map<String, String>> customCharsetNameToJavaEncodingByUrl | |
| customCharsetNameToMblenByUrl | back to summary |
|---|---|
| private static final Map<String, Map<String, Integer>> customCharsetNameToMblenByUrl Actual mysql charset name to mblen map of user defined charsets for given server URLs. | |
| customCollationIndexToCharsetNameByUrl | back to summary |
|---|---|
| private static final Map<String, Map<Integer, String>> customCollationIndexToCharsetNameByUrl Actual collation index to mysql charset name map of user defined charsets for given server URLs. | |
| customCollationIndexToCollationNameByUrl | back to summary |
|---|---|
| private static final Map<String, Map<Integer, String>> customCollationIndexToCollationNameByUrl | |
| customCollationNameToCollationIndexByUrl | back to summary |
|---|---|
| private static final Map<String, Map<String, Integer>> customCollationNameToCollationIndexByUrl | |
| customJavaEncodingUcToCharsetNameByUrl | back to summary |
|---|---|
| private static final Map<String, Map<String, String>> customJavaEncodingUcToCharsetNameByUrl | |
| customMultibyteEncodingsByUrl | back to summary |
|---|---|
| private static final Map<String, Set<String>> customMultibyteEncodingsByUrl | |
| errorMessageEncoding | back to summary |
|---|---|
| private String errorMessageEncoding The (Java) encoding used to interpret error messages received from the server. We use character_set_results (since MySQL 5.5) if it is not null or UTF-8 otherwise. | |
| javaEncodingUcToCharsetName | back to summary |
|---|---|
| public Map<String, String> javaEncodingUcToCharsetName | |
| metadataCollationIndex | back to summary |
|---|---|
| private int metadataCollationIndex | |
| metadataEncoding | back to summary |
|---|---|
| private String metadataEncoding What character set is the metadata returned in? | |
| multibyteEncodings | back to summary |
|---|---|
| public Set<String> multibyteEncodings | |
| passwordCharacterEncoding | back to summary |
|---|---|
| protected RuntimeProperty<String> passwordCharacterEncoding | |
| platformDbCharsetMatches | back to summary |
|---|---|
| private boolean platformDbCharsetMatches Does the character set of this connection match the character set of the platform | |
| requiresEscapingEncoder | back to summary |
|---|---|
| private boolean requiresEscapingEncoder If a CharsetEncoder is required for escaping. Needed for SJIS and related problems with ¥. | |
| serverSession | back to summary |
|---|---|
| private ServerSession serverSession | |
| session | back to summary |
|---|---|
| private NativeSession session | |
| sessionCollationIndex | back to summary |
|---|---|
| private Integer sessionCollationIndex | |
| NativeCharsetSettings | back to summary |
|---|---|
| public NativeCharsetSettings(NativeSession sess) | |
| buildCollationMapping | back to summary |
|---|---|
| private void buildCollationMapping() Builds the map needed for 4.1.0 and newer servers that maps field-level charset/collation info to a java character encoding name. | |
| characterSetNamesMatches | back to summary |
|---|---|
| private boolean characterSetNamesMatches(String mysqlEncodingName) | |
| checkForCharsetMismatch | back to summary |
|---|---|
| private void checkForCharsetMismatch() Determines if the connection charset is the same as the platform charset | |
| configurePostHandshake | back to summary |
|---|---|
| public void configurePostHandshake(boolean dontCheckServerMatch) Implements com. Doc from com. 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 by
| |
| configurePreHandshake | back to summary |
|---|---|
| public int configurePreHandshake(boolean reset) Implements com. Doc from com. 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 It also means that collation index should be set according to:
Since Protocol::HandshakeV10 and Protocol::HandshakeResponse41 use 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.
| |
| doesPlatformDbCharsetMatches | back to summary |
|---|---|
| public boolean doesPlatformDbCharsetMatches() Implements com.
| |
| getCollationIndexForCollationName | back to summary |
|---|---|
| public Integer getCollationIndexForCollationName(String collationName) Implements com.
| |
| getCollationIndexForJavaEncoding | back to summary |
|---|---|
| public int getCollationIndexForJavaEncoding(String javaEncoding, ServerVersion version) Implements com.
| |
| getCollationIndexForMysqlCharsetName | back to summary |
|---|---|
| public int getCollationIndexForMysqlCharsetName(String charsetName) Implements com.
| |
| getCollationNameForCollationIndex | back to summary |
|---|---|
| public String getCollationNameForCollationIndex(Integer collationIndex) Implements com.
| |
| getCommandBuilder | back to summary |
|---|---|
| private NativeMessageBuilder getCommandBuilder() | |
| getErrorMessageEncoding | back to summary |
|---|---|
| public String getErrorMessageEncoding() Implements com.
| |
| getJavaEncodingForCollationIndex | back to summary |
|---|---|
| public String getJavaEncodingForCollationIndex(int collationIndex) Implements com.
| |
| getJavaEncodingForCollationIndex | back to summary |
|---|---|
| public String getJavaEncodingForCollationIndex(Integer collationIndex, String fallBackJavaEncoding) | |
| getJavaEncodingForMysqlCharset | back to summary |
|---|---|
| public String getJavaEncodingForMysqlCharset(String mysqlCharsetName) Implements com.
| |
| getJavaEncodingForMysqlCharset | back to summary |
|---|---|
| public String getJavaEncodingForMysqlCharset(String mysqlCharsetName, String javaEncoding) | |
| getMaxBytesPerChar | back to summary |
|---|---|
| public int getMaxBytesPerChar(String javaCharsetName) Implements com.
| |
| getMaxBytesPerChar | back to summary |
|---|---|
| public int getMaxBytesPerChar(Integer charsetIndex, String javaCharsetName) Implements com.
| |
| getMetadataCollationIndex | back to summary |
|---|---|
| public int getMetadataCollationIndex() Implements com.
| |
| getMetadataEncoding | back to summary |
|---|---|
| public String getMetadataEncoding() Implements com.
| |
| getMysqlCharsetForJavaEncoding | back to summary |
|---|---|
| public String getMysqlCharsetForJavaEncoding(String javaEncoding, ServerVersion version) Implements com.
| |
| getMysqlCharsetNameForCollationIndex | back to summary |
|---|---|
| public String getMysqlCharsetNameForCollationIndex(Integer collationIndex) Implements com.
| |
| getPasswordCharacterEncoding | back to summary |
|---|---|
| public String getPasswordCharacterEncoding() Implements com.
| |
| getRequiresEscapingEncoder | back to summary |
|---|---|
| public boolean getRequiresEscapingEncoder() Implements com.
| |
| getServerDefaultCharset | back to summary |
|---|---|
| public String getServerDefaultCharset() Get 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
| |
| isImpermissibleCollation | back to summary |
|---|---|
| public boolean isImpermissibleCollation(int collationIndex) | |
| isMultibyteCharset | back to summary |
|---|---|
| public boolean isMultibyteCharset(String javaEncodingName) Implements com.
| |
| telemetryWrapSendCommand | back to summary |
|---|---|
| private void telemetryWrapSendCommand(Runnable command, TelemetrySpanName spanName, Object... args) | |
| tryAndFixEncoding | back to summary |
|---|---|
| private void tryAndFixEncoding(RuntimeProperty<String> encodingProperty, boolean replaceImpermissibleEncodings) Attempt to use the encoding, and bail out if it can't be used.
| |