<%@ include file="setupcache.jsp" %> <%@ page import="java.sql.*, javax.sql.*, oracle.jdbc.pool.*" %> ConnCache2 JSP

Hello <%= (request.getRemoteUser() != null? ", " + request.getRemoteUser() : "") %> ! I am Connection Caching JSP.


I get the Connection from the Cache and recycle it back.

<% try { Connection conn = cods.getConnection(); Statement stmt = conn.createStatement (); ResultSet rset = stmt.executeQuery ("SELECT User from dual"); if (rset.next()) { %>

Hi, <%= rset.getString(1) %>

<% } else { %>

Sorry, i don't know who you are

<% } rset.close(); stmt.close(); conn.close(); // Put the Connection Back into the Pool } catch (SQLException e) { out.println("

" + "There was an error doing the query:"); out.println ("

" + e + "
\n

"); } %>