sql/ getInt(??)
by "Rick Reumann" <rick_reumann(at)coxtarget.com>
|
| Date: |
Tue, 25 Apr 2000 13:48:34 -0400 |
| To: |
jSP-INTEREST(at)JAVA.SUN.COM |
| Cc: |
hwg-techniques(at)hwg.org |
| |
todo: View
Thread,
Original
|
|
I keep getting a "java.sql SQLexception: no current row" error from
the code posted below. The problem is coming in when trying to do
a rs.getInt(column) on a column that is created as sum of the
scores from various table columns. The sql is being done on an
informix database. I've tried even setting the columns with a name
(using AS) but still no luck. Our database administrator hasn't been
much help. Does anyone have any ideas. Thanks lots..rick.
try
{
PreparedStatement stmt2 =
invp.conn.prepareStatement( "select distinct
sc.og_id,(s1+s2+s3+s4+s5+s6+s7+s8+s9+s10+s11+s11+s12+s13
+s14+s15+s16+s17+s18+s19+s20+s21+s22+s23+s24) FROM
scores AS sc, ownergroups AS og WHERE (sc.og_id=og.og_id)
AND sc.og_id = ? and og.size = ? ORDER BY 2;" );
stmt2.setInt( 1, og_id );
stmt2.setString( 2, size );
rs2 = stmt2.executeQuery();
while ( rs2.next() ) // cycle through the periods for
the franchise
{
/**** ERROR IS CAUSED HERE ***/
anOgIdGroup.updateTotalScore(rs.getInt(2));
// call the method that adds this period score
to the totalScore
}
rs2.close();
stmt2.close();
}//end try block2
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.