|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Databases > PostgreSQL Help > Using ResultSet.getInt(), getting errors.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|