tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glyn Thomas" <>
Subject Problem with Displaying Result of a MySQL Join in Tomcat
Date Sun, 03 Aug 2008 00:02:37 GMT
I am in the process of converting a Tomcat front end for a MySQL database

Windows XP to Windows Vista.  


The XP version used MySQL Version 5.0.22, Tomcat 5.5.20, JRE 1.5.0 release

12 with Tomcat JDK 4 Compatibility Pack, and J/Connector 5.0.6.


The Vista version is using MySQL Version 5.0.51a, Tomcat 5.5.26, JRE

1.6.0_05, and J/Connector 5.1.6.


I am unable to display any parts of a result set that are retrieved from

JOINed tables in the Vista version - this works fine in the XP version.  I

already tried converting the queries to use JOIN syntax instead of WHERE

syntax, without improvement. 


For example, this query works correctly in the MySQL command line:




YN,i.MediaID,c.Description as 'Country', s.SubjectID, s.SubjectTypeID,

i.CountryID,i.PhotographerID, i.VolumeNumber FROM image_tbl i JOIN

lu_country_tbl c ON (i.countryid=c.countryid) JOIN xrf_image_subject_tbl si

ON (si.Imageid=i.imageid) JOIN subject_tbl s ON (si.Subjectid=s.subjectid)

WHERE (i.imageid=1234);


In JSP, I retrieve the results of this query into an rsImages variable, and

then iterate through the rows using:


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


Rows that retrieve directly from the image_tbl work correctly e.g.

${row.ImageID} will display the image ID.


However, elements from the joined tables, such as ${row.Country} and

${row.SubjectID} don't get retrieved.


Any ideas?



Glyn Thomas



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message