• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomcat 6 selects with alias are broken

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this app that has been working for years. Now, on a new server I can't get it to run.

It's not working with Tomcat 6 and MySql 5.0. Tomcat 5.5 and MySql 5.0 worked fine on the old server. Both servers are Linux with the Connector/J driver and DBCP connection pooling. The old server is mysql-connector-java-5.0.4 and the new one mysql-connector-java-5.1.13.

It all boils down to this. Any column in a SELECT using an alias does not return a value.

e.g. (the over simplified version)

<sql:query var="viewList">
SELECT id, events.id as evid FROM events LIMIT 10
</sql:query>

<c:forEach items="${viewList.rows}" var="vrow">
${vrow.id}, ${vrow.evid}
</c:forEach>

In this example, vrow.id resolved to the id. vrow.evid does not resolve to anything. No error either. Nothing.

In the real example, I need to use the aliases to resolve ambiguous columns due to several joins.

Can anyone please make suggestions? I'm stumped...

Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this bug.
 
Pete Carroll
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bingo!

Wow! That was crazy fast and straight to the point. Thanks.

Seriously... Who designs this stuff?

Is there some other syntax I'm supposed to know about to prevent this? Seems just plain broken to me...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Avoid using JSTL's sql tags would really help Have a look at this FAQ.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic