| Author |
About ResultSet problem!
|
Robert James
Greenhorn
Joined: May 06, 2005
Posts: 6
|
|
Turnpage JavaBean file is here .. Test.jsp is here ... Test.jsp Execute result is Pages:4 Total:32 error Would you like to tell me why the ResultSet rs didn't return . Thanks a lot. [ May 06, 2005: Message edited by: Bear Bibeault ]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Do you really think that this is a good way to deal with exceptions? What's likely happening is that your code is throwing an exception and it is getting "eaten" by your catch block. Never, ever do this! Either catch the exception and deal with it properly, or let it propogate outward so that the container can deal with it. By "eating" the exception as you have done here, you end up with head-scratching problems such as this.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Robert James
Greenhorn
Joined: May 06, 2005
Posts: 6
|
|
I'am Beginner. I don't know how to deal with this exception. in your opinion how you will do.. please help me change my code , make it work . thanks a lot. i hope the code ResultSet doesn't return null .
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
At a bare minimum, log it: This way you can go back to your log files and see what the problem was. Further than that, ask yourself. What do I want to do if the code in this block fails -- redirect to an error page, continue showing an empty table?
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
Since such an exception almost always means that either there's a bug in your code, or that the database itself is hosed, I let such exceptions propogate out to the container where the error handling mechansim that can be set up in web.xml causes a user-friendly "Oops!" page to be presented while logging the details of the error for me to diagnose. [ May 07, 2005: Message edited by: Bear Bibeault ]
|
 |
 |
|
|
subject: About ResultSet problem!
|
|
|