Connector/J Installation
2051
You can get the alias for a column in a result set by calling
ResultSetMetaData.getColumnLabel()
. To use the old noncompliant behavior with
ResultSetMetaData.getColumnName()
, use the
useOldAliasMetadataBehavior
option
and set the value to
true
.
In Connector/J 5.0.x, the default value of
useOldAliasMetadataBehavior
was
true
, but in
Connector/J 5.1 this was changed to a default value of
false
.
20.3.3.3.2. JDBC-Specific Issues When Upgrading to MySQL Server 4.1 or Newer
• Using the UTF-8 Character Encoding - Prior to MySQL server version 4.1, the UTF-8 character
encoding was not supported by the server, however the JDBC driver could use it, allowing storage of
multiple character sets in
latin1
tables on the server.
Starting with MySQL-4.1, this functionality is deprecated. If you have applications that rely on this
functionality, and can not upgrade them to use the official Unicode character support in MySQL
server version 4.1 or newer, add the following property to your connection URL:
useOldUTF8Behavior=true
• Server-side Prepared Statements - Connector/J 3.1 will automatically detect and use server-side
prepared statements when they are available (MySQL server version 4.1.0 and newer). If your
application encounters issues with server-side prepared statements, you can revert to the older
client-side emulated prepared statement code that is still presently used for MySQL servers older
than 4.1.0 with the following connection property:
useServerPrepStmts=false
20.3.3.3.3. Upgrading from MySQL Connector/J 3.0 to 3.1
Connector/J 3.1 is designed to be backward-compatible with Connector/J 3.0 as much as possible.
Major changes are isolated to new functionality exposed in MySQL-4.1 and newer, which includes
Unicode character sets, server-side prepared statements,
SQLState
codes returned in error
messages by the server and various performance enhancements that can be enabled or disabled using
configuration properties.
• Unicode Character Sets: See the next section, as well as
Section 10.1, “Character Set Support”
, for
information on this MySQL feature. If you have something misconfigured, it will usually show up as
an error with a message similar to
Illegal mix of collations
.
• Server-side Prepared Statements: Connector/J 3.1 will automatically detect and use server-side
prepared statements when they are available (MySQL server version 4.1.0 and newer).
Starting with version 3.1.7, the driver scans SQL you are preparing using all variants of
Connection.prepareStatement()
to determine if it is a supported type of statement
to prepare on the server side, and if it is not supported by the server, it instead prepares
it as a client-side emulated prepared statement. You can disable this feature by passing
emulateUnsupportedPstmts=false
in your JDBC URL.
If your application encounters issues with server-side prepared statements, you can revert to the
older client-side emulated prepared statement code that is still presently used for MySQL servers
older than 4.1.0 with the connection property
useServerPrepStmts=false
.
• Datetimes with all-zero components (
0000-00-00 ...
): These values cannot be represented
reliably in Java. Connector/J 3.0.x always converted them to
NULL
when being read from a
ResultSet.
Connector/J 3.1 throws an exception by default when these values are encountered, as this is the
most correct behavior according to the JDBC and SQL standards. This behavior can be modified
using the
zeroDateTimeBehavior
configuration property. The permissible values are:
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...