日期:2014-05-18 浏览次数:20687 次
<sql:setDataSource var="dataSrc" driver="org.gjt.mm.mysql.Driver" url="jdbc:mysql://localhost/mydb" user="root" password="123"/> <sql:query var="queryResults" dataSource="${dataSrc}"> select * from mytable </sql:query> <sql:update var="updateCount" dataSource="${dataSrc}"> INSERT INTO mytable values ('胡学文',4) </sql:update> <c:forEach var="row" items="${queryResults.rows}"> <tr> <td><c:out value="${row.username}"/></td> <td><c:out value="${row.passward}"/></td> </tr> </c:forEach>