JSTL help !

Hello,

Sorry for my english.

we have changing our mysq version version from 4 to 5. I encounter problems of bearing of a struts application which functioned without problem under mysql 4.

I have a query like this :

<sql:query dataSource="jdbc/mysql/MData" var="myQuery">

SELECT a.id AS id, a.numero AS num, a.name AS nam, a.departement AS dep,

b.returnType AS rt,

c.id AS cid, c.rdate AS rd,

IF ( SUM( IF(d.result = 'satistified', 1, 0) ) = 0 ,'-','yes' ) AS rc,

IF ( SUM( IF(d.injoignable='yes', 1, 0 ) ) = 0, '-','yes' ) AS inj,

FROM (atable a, btable b)

LEFT JOIN ctable c ON a.id = c.id_atable

LEFT JOIN dtable d ON a.id = d.id_atable

WHERE a.id = b.id_atable

GROUP BY num

ORDER BY rc DESC, inj DESC

</sql:query>

the requete execute correctly but nothing is posted with the screen using :

<c:forEach var="row" items="${myQuery.rows}">

<c:out value="${row.id}"/>

<c:out value="${row.num}"/>

....

Please HELP :-(

[1097 byte] By [aynifa] at [2007-10-2 13:08:58]
# 1
Just a couple of generic questions1 - does that query return anything when you run it directly on the mysql database?2 - have you updated your MySQL JDBC driver in the /common/lib directory? (I'm presuming it is there as you seem to be using JNDI)
evnafetsa at 2007-7-13 10:35:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
1- yes the query return the id...2- the application functions correctly before i passe to mysql 5. it's not a problem of driver
aynifa at 2007-7-13 10:35:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

>2- the application functions correctly before i passe to mysql 5. it's not a problem of driver

I would try it just to be sure.

The JDBC driver is the link between java and MySQL database.

You have changed the database. It may be that your driver is having problems talking to the new version?

If all you have changed is the database, I wouldn't go looking at the java code - its either the database or the JDBC driver.

Other avenues to explore:

Maybe also check your configuration of the datasource to see if it is connecting to the correct database?

Any error messages in the logs?

Does a simpler query work?

evnafetsa at 2007-7-13 10:35:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thank you evnafets for your assistance. The query functions correctly and there is no error in the logs. If I change alias in the sql query, for example instead of row.dep, I put row.departement, then the value of the department is posted.
aynifa at 2007-7-13 10:35:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
What do I have to make when one passes from tomcat4, mysql4 to tomcat5 and mysql5. What must I modify?
aynifa at 2007-7-13 10:35:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...