This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Hi there: I'm a novice in Java and my application keeps crashing with the same error. It looke I'm not closing something, and I just can't find the fix. This is a sample of the code. Please, please someone tell me what is wrong with it:
There are number of strange elements in your code. Like the ResultSet rs which is NEVER used as far as I can see. You do a lot of if(rs!=null) but I can't see any reason for it not to be null.
I also find it odd that you use three seperate connections but reuse the statement. I don't think any of this will cause an error but it sure is odd.
I also notice you seem to have try with no catch but a finally. It might be nice if you caught the exception and did something... printing it out would be good for starters but in future you could take other appropriate action.