<sql:setDataSource var="dataSrc"    url="jdbc:mysql:///taglib" driver="org.gjt.mm.mysql.Driver"    user="admin" password="secret"/>
    <sql:query var="queryResults" dataSource="${dataSrc}">
      select * from blog group by created desc limit ?  
      <sql:param value="${6}"/>
    </sql:query>
<table border="1">  <tr>    <th>ID</th>    <th>Created</th>    <th>Title</th>    <th>Author</th>  </tr>
<c:forEach var="row" items="${queryResults.rows}">  <tr>    <td>
  <c:out value="${row.id}"/></td>    <td>
  <c:out value="${row.created}"/></td>    <td>
  <c:out value="${row.title}"/></td>    <td>
  <c:out value="${row.author}"/></td>  </tr>
</c:forEach>
</table>
下面是事务支持方面:
<sql:transaction>    <sql:update sql="update blog set title = ? where id = ?">    
    <sql:param value="New Title"/>    
    <sql:param value="${23}"/>  
  </sql:update>    <sql:update sql="update blog set last_modified = now() where id = ?">
  <sql:param value="${23}"/>
  </sql:update></sql:transaction>