What DBMS are you using, and what driver?
I know some ddrivers have certain settings that speed up retrieval but also
expect you to get the resultset data in proper column order. try to add
rs.getInt(1);
as the first line in the loop.
Or you could try to name the column instead of using the number.
BTW, your db design doesn't look very normalized to me ;-)
Geert 'Darling' Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rick Reumann
> Sent: dinsdag 25 april 2000 19:49
> To: [EMAIL PROTECTED]
> Subject: sql/ getInt(??)
>
>
> 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
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets