I'm using the following code to query a database from my jsp, but I'd like to know more about what's happening behind the scenes.
These are my two primary questions.
Does the tag access the ResultSet directly, or is the query result being stored in a datastructure in memory?
When is the connection closed?
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:query var="query" dataSource="${ds}" sql="${listQuery}"></sql:query>
<c:forEach var="row" items="${query.rows}" begin="0">
${row.data }
${row.more_data }
</c:forEach>
Note: I've always been against running queries in the jsp, but my result set is too large to store in memory between my action and my jsp. Using this tag library looks like the easiest solution.