Should I close statement after every query?
Posted by: Lebing Xie
Date: February 05, 2008 06:20AM

Hallo,

I have build a little address book based on basic JDBC-mysql (without datasource). Same query and statement is used very frequently. Of course the resultset is closed after ervery query, as well as Statement? Can I use such as singleton Statement for all query in long period? or have to close and create a new one for every query.

2 After a long period, sometimes i got a "broken pipe" or other error, which can be solved with restarting server. So is there any solution (coding as well as maintains ) for such scenario?

Options: ReplyQuote


Subject
Written By
Posted
Should I close statement after every query?
February 05, 2008 06:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.