Railo and MySQL column alias

This seems like a very odd situation, but Railo has stopped supporting column aliases by default – well it’s the JDBC database driver I think… I’m not too good at all this back end java/database stuff.

But basically it all worked fine, now I’ve upgraded Railo, and things like this will throw an error.

SELECT col1 AS colOne FROM table

I don’t see why, this is such a common thing to do… Anyway, some one else has had the exact same problem not that long ago, and Google very kindly found me their blog post so I could fix it.

You just have to set “Alias Handling” to “true” for your datasources in the Railo Server Administrator. Then every thing works fine again.

I think the point of it is something to do with being able to grab the true column name and get hold of better metadata, but at the moment that’s no use to me!

I really hope Adobe don’t start doing this with Coldfusion!

Credit has to go to Anuj Gakhar for this fix: http://www.anujgakhar.com/2012/01/11/railo-mysql-and-column-aliases/

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s