Mega Code Archive

 
Categories / Java / JSP
 

Using the SortedMap

<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> <html> <head> <title>Using the SortedMap[] </title> </head> <body> <h1>Address List</h1> <sql:setDataSource dataSource="jdbc/address" var="conn" /> <sql:query dataSource="${conn}" var="addresses">     SELECT * FROM AddressList </sql:query> <table width="90%" border="1"> <!-- add the table rows from the result set --> <c:forEach var="row" items="${addresses.rows}">   <tr>     <c:forEach var="column" items="${row}">       <td><c:out value="${column}"/></td>     </c:forEach>   </tr> </c:forEach> </table> </body> </html>