I have a JDBC working with Oracle 9i where database is inserted/updated maybe 10 times at most during a week with very little usage in my Tomcat 4.1.3 Container.
The Database classes I have used for the past year are working great but I wonder if I should be closing anything in my database helper class with Prepared statements:
When I experiment and put a close statement in the DbInsert class method then my database insert wont work because it would be closed when it is called in the DbWork class?
Please advise. [ November 08, 2007: Message edited by: Joseph Smithern ]
Les Hayden
Greenhorn
Joined: Jun 19, 2002
Posts: 28
posted
0
you say
put a close statement in the DbInsert class method
but in your code you use connection.close();. If you indeed want to close the statement then you should use
Les Hayden
Joseph Smithern
Ranch Hand
Joined: Feb 11, 2006
Posts: 89
posted
0
Thanks, I was also wondering if the way I am doing it is not recommended because I am keeping the Connection and PreparedStatement as an instance variable.
Is this better or more efficient way where I combine it into one class??
[ November 12, 2007: Message edited by: Joseph Smithern ]