Iam getting an exception as "too many connection" by db after hitting db 10-20 times.
it works well in 10-20 hits to db but after that i got this error
is there anyother way to close the connection?,if i dont want to close the connection in my each jsp page.?.
my context.xml entry is like this
i set maxActive=30
please help i dont want to close the connection in my each JSP page...
is there anyother way provided by APACHE to close the connetion and get the objects back in pool.
First of all, you shouldn't be using the Connection in any JSP page. The JSP is for rendering the view. All JDBC code should be in a Java class.
Second, you have to close the connection everyplace you use it. Whether that is a JSP or Java class it is the same thing. Every place that obtains a connection is responsible for closing it. Anything else is a connection leak.
ok i will definitely pay attention on your word ,, But my question that ,i m using connection pool by apache and is there any way to close the connection without using conn.close() in every where..is there any functionality provide by apache.