'AS' keyword not working?
Posted by: Brian Nuker
Date: May 24, 2008 12:21PM

Hello MySQL Community,

If I use a query containing 'AS', for example "SELECT hardware.HardwareId, brand.Name AS 'BrandName' FROM brand, hardware WHERE hardware.BrandId = brand.BrandId", the columnname of the brand.Name AS 'BrandName' will still be displayed as 'Name', but I want it to be displayed as 'BrandName'. Is the AS keyword not working?

ResultSetMetaData rsmd = rs.getMetaData();
String strColumn = rsmd.getColumnName(2); (lets pretend we did the query above)

results into strColumn being 'Name' instead of what I wanted it to be: 'BrandName'.

I'm using MySQL 5.0.51a, J/Connector 5.1.6 and Java 1.6.0

Yours Sincerly,

Brian Setz

Options: ReplyQuote


Subject
Written By
Posted
'AS' keyword not working?
May 24, 2008 12:21PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.