I have a website which is getting a massive number of hits. I’m experienced problems, including JDBC connection errors.
I’m a bit confused about closing PreparedStatement. Do I need to close PreparedStatement or is it just enough to only close Statement?
Also, what about ResultSet? Do I need to close it too?
Yes, you have to close the prepared statements (
PreparedStatementObject) and result sets as they may cause memory leakage.For more information, see Using Prepared Statements.