This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes query database/output count and summation to servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "query database/output count and summation to servlet?" Watch "query database/output count and summation to servlet?" New topic
Author

query database/output count and summation to servlet?

Nicole Jones
Greenhorn

Joined: Mar 18, 2011
Posts: 21
I have this database query that adds the total dollar amount by funder and counts the number of projects per funder. obviously, neither the total or the count is stored in my database....should it be? because how would i access the count and total from a servlet if neither are stored the database?

here is my query:

Any help will be greatly appreciated.
Nicole Jones
Greenhorn

Joined: Mar 18, 2011
Posts: 21
Nevermind, doh. I figured it out.

This is the desired query:



code to set the alias columns:

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Yep, that should work fine. Here's another method which doesn't require aliases for the computed columns:

(The columns are numbered from left to right in the query, starting at 1.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: query database/output count and summation to servlet?
 
Similar Threads
SELECT COUNT
Passing Database query results through a method to a JTable
DB structure
Servet and Jdbc
jdbc and servlets