File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Infuriating JSP MySQL exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Infuriating JSP MySQL exception" Watch "Infuriating JSP MySQL exception" New topic

Infuriating JSP MySQL exception

Faisal Ul-Haque

Joined: Dec 02, 2011
Posts: 10
As the title says, I have an infuriating problem with a JSP page which I have wasted more than three hours of my life on...

I am carrying out a SQL transaction which returns a result set with the results. However, calling next() on it results in the following exception:

java.sql.SQLException: Illegal operation on empty result set

The meaning of the exception is obvious enough but strangely, the SQL statement works perfectly infinitely when run in a GUI SQL interface. However, the infuriating part is where I removed all java code from the JSP page and still this stupid exception is thrown. I have lost count of the numner of times I have tried stopping/starting/reloading the project and stopping/starting the server (Tomcat 7) so I am very close to introducing my PC to a new friend (my fist). Any help with this problem greatly appreciated to save me having to buy a new PC when I can ill afford it...

Tim Moores

Joined: Sep 21, 2011
Posts: 2408
Post an SSCCE (<-- that's a link) that demonstrates the problem.
Faisal Ul-Haque

Joined: Dec 02, 2011
Posts: 10
Tim Moores wrote:Post an SSCCE (<-- that's a link) that demonstrates the problem.

Yes I was aware of that but as the JSP page is called from another JSP page and I don't have a hosting deal set up yet, it didn't occur to me.

Either way, I should be introducing this new friend (fist) to my head as the problem is now solved (the wrong JSP page was listed in the form's action).

Thank you anyway for your quick reply.
I agree. Here's the link:
subject: Infuriating JSP MySQL exception