title: How to solve ORA-12516 error?
body: <p>I am using oracle database 10g express edition. Recently I am facing ORA-12516 error frequently. It says -- 
  "java.sql.SQLException: Listener refused the connection with the following error:
  ORA-12516, TNS:listener could not find available handler with matching protocol stack
  The Connection descriptor used by the client was:
  //127.0.0.1:1521/XE"</p>
  
  <p>As far as I am concerned this error is shown when user doesn't close variables like "Statement" "Resultset" and opens a lot of them.
  Every time I created any "Statement" or "ResultSet" type variables in a function I used this function -- <a href="http://paste.ubuntu.com/7902053/" rel="nofollow noreferrer">http://paste.ubuntu.com/7902053/</a>    to close those variables. I didn't close those variables in a final block of the function inside which those were declared. Instead I called this function (close_calls(..)) to close those variables and sent them as parameters inside the function close_calls(..). For example I called the function given above in no 17 and 23 line here -- <a href="http://paste.ubuntu.com/7902114/" rel="nofollow noreferrer">http://paste.ubuntu.com/7902114/</a></p>
  
  <p>But this error is still shown in the console. Is close_call(...) not working ? How can I get rid of this error ? I got the idea of closing those variables from here --- <a href="https://stackoverflow.com/questions/2225221/closing-database-connections-in-java">Closing Database Connections in Java</a></p>