I want to use a valid SQL statement in my JSP like this:
<sql:query var="test" dataSource="DL">
select p.name name, j.description job_description, d.description department_description
from person as p, job as j, department as d
where ...
</sql:query>
Since I join 3 tables I have 2 duplicate names: "description", which I normally solve in SQL using aliases for those field names. In JSP this is not handled correctly, the resultset is not accessible via the aliases and only "description" is available, but not "job_description" or "department_description".
this works insufficient:
<c:forEach var="row" items="${test.rows}">
${row.description}
</c:forEach>
this does not works at all:
<c:forEach var="row" items="${test.rows}">
${row.job_description}
</c:forEach>
Is there any solution on this problem (which is IMHO a bug)?
This is my context.xml:
<Context path="/test" docBase="test" reloadable="true" crossContext="true">
<Resource
name="DL"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="xxx"
password="xxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test"/>
</Context>