Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.sql.SQLException: After end of result set

843859Apr 30 2007 — edited May 1 2007
I am getting this error :java.sql.SQLException: After end of result set
plz help me in fixing it ......thanks!!!
ps=con.prepareStatement("select * from Match_Set where Match_ID=? and Winner=? ");
 ps.setInt(1,matchID);
 ps.setInt(2,win);
 rs=ps.executeQuery();
 while(rs.next())
 {
if (rs.getInt(9)==1)
{
if(rs.getInt(8)==1)
{
ps=con.prepareStatement("select * from Bets where Match_ID=?");
ps.setInt(1,matchID);
rs=ps.executeQuery();
while(rs.next())
{
i1=rs.getInt(1);
s1=rs.getString(3);
f1=rs.getFloat(5);
ps=con.prepareStatement("select * from User where User_ID=?");
ps.setInt(1,i1);
rs=ps.executeQuery();
while(rs.next())
{
s3=rs.getString(2);
}
processBean=new ProcessBean();
processBean.setUser_identity(i1);
processBean.setUserName(s3);
processBean.setTeam1(s1);
processBean.setBetting1(f1);
System.out.println("MatchID"+matchID);
System.out.println("UserID"+i1);
System.out.println("Username"+s3);
System.out.println("UserTeam"+s1);
System.out.println("UserBettingTeam"+f1);
user_List.add(processBean);
}//while
return user_List;
}//condition for team1
if (rs.getInt(8)==2)
{
ps=con.prepareStatement("select * from Bets where Match_ID=?");
ps.setInt(1,matchID);
rs=ps.executeQuery();
while(rs.next())
{
i2=rs.getInt(1);
s2=rs.getString(4);
f2=rs.getFloat(6);
ps=con.prepareStatement("select * from User where User_ID=?");
ps.setInt(1,i1);
rs=ps.executeQuery();
while(rs.next())
{
s4=rs.getString(2);
}
processBean=new ProcessBean();
processBean.setUser_identity(i2);
processBean.setUserName(s4);
processBean.setTeam1(s2);
processBean.setBetting1(f2);
System.out.println("MatchID"+matchID);
System.out.println("UserID"+i2);
System.out.println("Username"+s4);
System.out.println("UserTeam"+s2);
System.out.println("UserBettingTeam"+f2);
user_List.add(processBean);
}//while
	//return user_List;
}//condition for team2
}//if of team2
}//while
}//try
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 29 2007
Added on Apr 30 2007
3 comments
887 views