This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
For what it's worth, I wouldn't reuse Statement objects across web requests, but instead create them for each new request. Also be aware that the JDBC/ODBC bridge driver you're using is not thread-safe, so if multiple requests come in at the same time, the will be trouble.
To confirm, the result set is null at both of these, or just the first one? We would expect it to be a null at the first println. If it is null at the second println, there is some problem with your driver.
Here if there is a problem getting a connection or a statement object, the program catches the exception and lets it proceed to the next method. This is bad programming to suppress such critical exceptions. In doPost(), your statement object may be null, which is a potential candidate for a NullPointerException to be thrown.
Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com