import javax.servlet.jsp.jstl.sql.*; 这个包的用途是?
1个回答
展开全部
在jsp上通过jstl的sqltag来操作数据库
<sql:query var="customer" datasource="${datasource}"
SELECT * FROM customers WHERE state = ´CO´ ORDER BY city
</sql:query>
<table>
<c:forEach var="row" items="${customers.row}">
<tr>
<td><c:out value="${row.custName}" /></td>
<td><c:out value="${row.address}" /></td>
</tr>
</c:forEach>
</table>
<sql:query var="customer" datasource="${datasource}"
SELECT * FROM customers WHERE state = ´CO´ ORDER BY city
</sql:query>
<table>
<c:forEach var="row" items="${customers.row}">
<tr>
<td><c:out value="${row.custName}" /></td>
<td><c:out value="${row.address}" /></td>
</tr>
</c:forEach>
</table>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询