PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old April 1st, 2008, 06:14 PM
saikk saikk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 17 saikk Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 h 59 m 6 sec
Reputation Power: 0
Using ResultSet.getInt(), getting errors..

Result Set rs;
int sum=0;
while(rs.next() )
{
sum += rs.getInt(1);
}
assertEquals(value, sum);


The assertEquals(value,sum) fails.

Can anybody throw some light ?

Thanks.

Reply With Quote
  #2  
Old April 3rd, 2008, 11:07 AM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,677 stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level)stdunbar User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 3 h 59 m 46 sec
Reputation Power: 301
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
Um, the database doesn't have what you expect in it? Why don't you do something like:

Code:
Result Set rs;
int sum=0;
while(rs.next() )
{
    int nextInt = rs.getInt(1);
    System.out.println( "the next int is " + nextInt );
    sum += nextInt;
}
assertEquals(value, sum);


and make sure you're getting the results you want.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Using ResultSet.getInt(), getting errors..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway