if i do:
SELECT PEvent.publicID AS 'ID'...
Results come as "publicID" not as "ID"
to make it work i have to do:
SELECT concat(PEvent.publicID, '') AS 'ID'
why?
maxActive="10" maxIdle="3" maxWait="1000" type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="1000" type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="1000" type="javax.sql.DataSource"
maxActive="10" maxIdle="3" maxWait="1000" type="javax.sql.DataSource"
a very bad thing that something as simple as a column alias does not work...
解决方案
It works fine for me when I tested this from my ubuntu mysql command line, and MySQL Workbench for Windows. I figured it might be a jdbc thing, and searched around. MySQL doesn't consider this as a bug.
From the comment on the BZ,
This is a change required for JDBC-compliance. RSMD.getColumnName() is required to return the actual column name. Aliases are returned via RSMD.getColumnLabel().
If you want the older non-compliant behavior from Connector/J 3.1, use the "useOldAliasMetadataBehavior" configuration parameter present in the 5.0 nightly builds, and set it to "true".