aspose file tools*
The moose likes JSP and the fly likes Problem iterating rows of a ResultSet with JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem iterating rows of a ResultSet with JSP" Watch "Problem iterating rows of a ResultSet with JSP" New topic
Author

Problem iterating rows of a ResultSet with JSP

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

I hope this is the correct forum because this may have something to do with Sun One Studio and it may have something to do with Tomcat.
Here is my JSP code

I have trying to go through one of the tutorials from Sun One. Everything was going great until I tried to run the Web Module in Sun One.
I get the following error


I have the MySQL JAR Driver file in the Common/lib folder in my tomcat Folder. I don't really know why I am getting this error message.
If this needs to be moved, please do so.
Thanks.
[ January 14, 2003: Message edited by: Gregg Bolinger ]
[ January 15, 2003: Message edited by: Gregg Bolinger ]

GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Ok, figured out my first problem. I didn't realize that the Module was actually executing from the Project Directory I created when I made the Web Module. So I have to add my jar file to that PATH.
But now I am getting a new message, and I do believe this is a JSP problem for sure.
The JSP code is the same as above and here is my error message

Any ideas? I have NO IDEA what that error message means. I even tried changing the ID field in my databae to a type VARCHAR thinking it couldn't handle the TINYINT type but still getting that error.
Thanks
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Well, I may have found my problem. There is an error in the PDF documentation for the Sun One CDShopCart example. Below is the relivant code:
The PDF has:
<c:forEach var="row" items="productQuery.rows" >
The correct syntax is:
<c:forEach var="${row}" items="${productQuery.rows}" >
However, my resultset is empty and I know there is data in the database because I use it everyday. So now I am searching for a solution to this. If anyone knows why I am all ears, otherwise, I will continue to search and if I find the solution I will post it here.
I am kind of sad no one has tried to help me yet.
But I still love the Ranch.
[ January 15, 2003: Message edited by: Gregg Bolinger ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Ok, solved the problem. Again, the tutorial was wrong initially, then I was wrong when trying to correct it.
Tutorial:
<c:forEach var="row" items="productQuery.rows" >
My initial fix:
<c:forEach var="${row}" items="${productQuery.rows}" >
Actual Solution
<c:forEach var="row" items="${productQuery.rows}" >[/b]
So there it is.
Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
Glad we could help
Give us an easier problem next time!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem iterating rows of a ResultSet with JSP