Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="s" %>
- <html>
- <body>
- <s:setDataSource var="ds" driver="oracle.jdbc.driver.OracleDriver"
- url="jdbc:oracle:thin:@localhost:1521:orcl"
- scope="session" user="system" password="admin" />
- <s:query var = "cust" dataSource="${ds}">
- select customerId,customerName,customerAddress,billAmount from customer
- </s:query>
- <table border=1>
- <c:forEach var="row" items="${cust.rows}">
- <tr>
- <td><c:out value="${row.customerId}"/></td>
- <td><c:out value="${row.customerName}"/></td>
- <td><c:out value="${row.customerAddress}"/></td>
- <td><c:out value="${row.billAmount}"/></td>
- </tr>
- </c:forEach>
- </table>
Add Comment
Please, Sign In to add comment