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

Reply via email to