Questo è il "file.jsp":
Codice HTML:
<html>
<head><title>JDBC with JSTL</title></head>
<body>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<sql:setDataSource driver="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/queryjdbc?user=root&password=MIAPWD" var="conn1" />
<sql:query var="persone" dataSource="${conn1}">select * from persona order by cf /sql:query>
<table border=1 align="center">
<thead><th>Codice Fiscale </th><th>Nome </th><th>Cognome </th></thead>
<tbody>
<c:forEach var="row" items="${persone.rows}">
<tr>
<td> <c:out value="${row.cf}"/> </td>
<td> <c:out value="${row.name}"/> </td>
<td> <c:out value="${row.cognome}"/> </td>
</tr>
</c:forEach>
</tbody>
</table>
</body>
</html>