• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Using aggregate sql (sum) in a jstl sql action

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a problem that I couldn't find addressed on the web, but which I eventually figured out. Here's the scenario. I was trying to do this:




But I would get this error message:

Property 'COST' not found on type java.lang.String



Of course I could find the sum in my jsp as follows:



But I'd rather have the DBMS do the summing for me. So I tried this:



This actually worked. However since I knew I was only going to get a single value back from the query, I also tried replacing the loop with this:



That worked like a charm. ${clientShipping} now held the sum returned by the sql query.
[ September 24, 2008: Message edited by: deb platt ]
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic