Documentation Home
MySQL Connector/J 5.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 501.4Kb
PDF (A4) - 500.9Kb
HTML Download (TGZ) - 120.7Kb
HTML Download (Zip) - 139.0Kb


MySQL Connector/J 5.1 Developer Guide  /  ...  /  Upgrading to MySQL Connector/J 5.1.x

3.3.1 Upgrading to MySQL Connector/J 5.1.x

  • In Connector/J 5.0.x and earlier, the alias for a table in a SELECT statement is returned when accessing the result set metadata using ResultSetMetaData.getColumnName(). This behavior however is not JDBC compliant, and in Connector/J 5.1, this behavior has been changed so that the original table name, rather than the alias, is returned.

    The JDBC-compliant behavior is designed to let API users reconstruct the DML statement based on the metadata within ResultSet and ResultSetMetaData.

    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.


User Comments
User comments in this section are, as the name implies, provided by MySQL users. The MySQL documentation team is not responsible for, nor do they endorse, any of the information provided here.
Sign Up Login You must be logged in to post a comment.