Documentation Home
MySQL Connector/J Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 483.4Kb
PDF (A4) - 484.7Kb
EPUB - 160.8Kb
HTML Download (TGZ) - 129.5Kb
HTML Download (Zip) - 154.1Kb


MySQL Connector/J 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
Sign Up Login You must be logged in to post a comment.