I am attempting to port a Tomcat/MySql application from OSX to Windows 7
(I previously ported it from Vista to OSX, so it shouldn't be as difficult
as it sounds), and am having problems with back-compatibity on some
queries.

The application works correctly on OSX, with Tomcat 5.5, JRE 1.5.0 R12,
Tomcat JDK 4 Compatibility Pack, J/Connector 5.1.14 and MySql 5.0.

On Windows 7, my configuration is Tomcat 5.5.34, JRE 1.6.0 R26, J/Connector
5.1.18, MySql 5.5.  (I tried both with and without the JDK 4 Compatibility
pack and it doesn't make a difference).

The following test JSP shows the problem:

<%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"; %>
<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Test</title>
</head>
<body>
<h1>Results</h1>
      <sql:query var="rsImages" dataSource="jdbc/Images">
SELECT
i.imageID,i.DateDay,i.DateMonth,i.DateYear,i.Location1,i.Location2,i.ScannedYN,c.description
AS country,sd1.description AS Subject, sdt.fieldtypeid, sdt.lookuptablename
FROM image_tbl i, lu_country_tbl c, xrf_image_subject_tbl si, subject_tbl
s, subject_detail_tbl sd1, lu_subject_detail_type_tbl sdt
WHERE (i.countryID=c.CountryID) AND (si.SubjectID=s.SubjectID) AND
(si.ImageID=i.ImageID)
AND (s.SubjectID=sd1.subjectID) AND
(sd1.subjectdetailtypeid=sdt.subjectdetailtypeid) AND
(sd1.subjectdetailtypeid IN (1,2,6,8,9,13)) and i.imageid=20002
      </sql:query>
ID: ${rsImages.rows[0].ImageID}<br>
Location: ${rsImages.rows[0].Location1}<br>
Country: ${rsImages.rows[0].country}<br>
Subject: ${rsImages.rows[0].subject}<br>
Description: ${rsImages.rows[0].Description}<br>
ID: ${rsImages.rows[1].ImageID}<br>
Location: ${rsImages.rows[1].Location1}<br>
Country: ${rsImages.rows[1].country}<br>
Subject: ${rsImages.rows[1].subject}<br>
Description: ${rsImages.rows[1].Description}<br>
</body>
</html>

When running this page, ID, Location and Description are all returned with
values.  However, country and Subject are not returned at all.  You will
note that country and Subject are both aliased in the query.  Description
is not a directly requested in the query, but is returning the contents of
sd1.description.

I seem to recall having a similar issue when first porting to OSX and
having to set backward compatibility somewhere, but can't find my records
for this anywhere.  Anyone got any ideas?

Thanks
Glyn Thomas

Reply via email to