• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying Multiple values Returned from a Stored Procedure using JSTL

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a stored procedure that can return up to 10 values. Is there a way to use jstl to go through the values to see if there is a match to a predefined variable.

As an example. The SP returns 3 types of fruit
Orange
Banana
Apple


I have a variable defined as FruitA = 'Apple'. I want to take the value of the stored procedure and assign it to variable defined as FruitB. Then I want to compare the 2 and if they match then display some text.

Here is my code but it only returns the first value that the stored procedure returns:

 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's because resultsets are not suitable for use in a JSP. In your Java code, collect the resultset values into a Java collection for passing to the JSP.
 
reply
    Bookmark Topic Watch Topic
  • New Topic