Bob Matthews wrote:apologies.......................
Proper code style helps you find some types of bugs quickly. It also says to us "please put some effort into helping me, I'm at least willing to put the effort in to properly indent my code". Take pride in your code. I'm afraid to say your attempt at formatting was haphazard. If you don't want to format by hand then invest the time into learning an IDE, or, look at the rudimentary indenter written in Java in the link in my signature. This was run through an Eclipse formatter.
Yes - I agree with your comments.....................
I have just spent some time with Netbeans and reformmated my whole program
I don't think there is a bug in the error trapping routine (as suggested)
and I still have my original problem
posted 2 months ago
I don't understand what all this exception handling code has to do with the original problem.
I'll say it again: code doesn't just stop running. If it appears so then there may have been an exception that was swallowed by some catch statement that ignores it (needless to say, not a good catch statement).
From this excerpt it's unclear if printSQLException is ever called - is it? Does it print information somewhere where you will see it?
posted 2 months ago
Line 10 coding was in error - requires string concatination
Tim Moores wrote: If it appears so then there may have been an exception that was swallowed by some catch statement that ignores it (needless to say, not a good catch statement).
And if I ever have to maintain such code, the author of said atrocities can expect to feel the full force of my wrath.
Never silently discard the results of an Exception. Not conditionally, not unconditionally. Even if the catch clause cleanly and completely handles the exception, for the sake of maintainability, make the Exception loggable. If you're creating a new Exception in your catch clause and throwing it, attach the original Exception in the "caused by" part of the new Exception.
An IDE is no substitute for an Intelligent Developer.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database