cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Hübner" <sthueb...@googlemail.com>
Subject Re: SQLTransformer vs. column aliases
Date Fri, 23 Feb 2007 11:29:53 GMT
I actually found the reason for this behaviour. MySQL Connector/J
5.x's implementation has been changed not to return column labels but
their names, that is the original columns' names. According to
http://bugs.mysql.com/bug.php?id=21596, the reason for changing the
implementation was to make it more JDBC compliant. So it's not a bug,
it's actually a feature.

Since SQLTransformer uses getColumnName(), no column aliases make it
into the output. Should SQLTransformer's implementation be altered
then?

Those who use MySQL Connector/J 5.x and rely on aliases should use the
useOldAliasMetadataBehavior-option in their jdbc-URL. This works from
Connector/J 5.0.4 onward.

Thanks again, Tobia, for pointing me in that direction!
-Stefan

2007/2/22, Stefan Hübner <sthuebner@googlemail.com>:
> Thanks Tobia,
>
> I'm working with MySQL too. Maybe I should have a look at their docu.
>
> -Stefan
>
> 2007/2/22, Tobia <tobia.conforto@linux.it>:
> > Stefan Hübner wrote:
> > > Dev at weitling <dev@weitling.net>:
> > > > select a.name as aName, a.id as aID, b.id as bID, b.name as bName
> > >
> > > no, disappointingly enough, that doesn't work.
> >
> > It works here, using MySQL.
> > Maybe it depends on the SQL engine?
> >
> > If you can't get the "as" keyword to work, you can always use some XSLT
> > to tell them apart or to rename them:
> >
> > <xsl:template match="sql:rowset/sql:row/sql:id[position() = 1]">
> >
> > <xsl:template match="sql:rowset/sql:row/sql:id[position() = 2]">
> >
> >
> > Tobia
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
Mime
View raw message