I have a method that inserts data into my Oracle 9i database with no problems and no Database closing issues:
Now when I put the method (inserter) in another class called OtherClass, it does insert the data but now I have database closing issues:
In my SQL Plus database resource check I see JDBC Thin Client is opened and not closed after each insert with the above attempt. This didnt happen when I had the method in the same class.
Please advise. [ October 15, 2007: Message edited by: Ed Carrington ]
Even though this probably sounds excessive, your finally code should be protected line by line as such:
I've seen people not do this in the past and keep in mind, if an rs.close() or stmt.close() fails then without this type of structure the conn.close() might not be executed.
If it helps I usually add these add as static utility functions so I don't have to write this over and over again.
Originally posted by Scott Selikoff: Even though this probably sounds excessive, your finally code should be protected line by line as such:
I've seen people not do this in the past and keep in mind, if an rs.close() or stmt.close() fails then without this type of structure the conn.close() might not be executed.
If it helps I usually add these add as static utility functions so I don't have to write this over and over again.
Thanks I added as you suggested and still have the database closing issue. Please advise.