robmaceachern / cpsc304

Our sweet 304 project
1 stars 1 forks source link

rs.next not return all results #7

Closed rc9 closed 12 years ago

rc9 commented 12 years ago

I don't know if you guys have seen this, but I came across it and don't understand what the problem is. I tried using a loop (while(rs.next())) but it only ever goes through it once.

When I tried making a second result set and statement I got an exception: java.sql.SQLException: Operation not allowed after ResultSet closed

I don't get this using the one result set. See checkOverdue() for error.

robmaceachern commented 12 years ago

I'll take a look at this later tonight.

Rob MacEachern (778) 938-1066

On Mon, Nov 21, 2011 at 12:02 AM, rc9 < reply@reply.github.com

wrote:

I don't know if you guys have seen this, but I came across it and don't understand what the problem is. I tried using a loop (while(rs.next())) but it only ever goes through it once.

When I tried making a second result set and statement I got an exception: java.sql.SQLException: Operation not allowed after ResultSet closed

I don't get this using the one result set. See checkOverdue() for error.


Reply to this email directly or view it on GitHub: https://github.com/robmaceachern/cpsc304/issues/7

robmaceachern commented 12 years ago

Did you get this sorted out?

You're kinda doing some strange stuff in checkOverdue(). Lots of queries within loops... I don't think Georgie would approve! :(

I think the big problem is that you're trying to use some of the jdbc objects (ie Connection, Statement, ResultSet, etc) between methods and the system isn't happy about that. Get rid of all the instance variables on ClerkDao except for ConnectionService and try to keep the jdbc stuff in the narrowest scope possible (ie one each per query).