Guest User

Untitled

a guest
Sep 12th, 2018
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  2. <%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="s" %>
  3.  
  4. <html>
  5. <body>
  6.  
  7. <s:setDataSource var="ds" driver="oracle.jdbc.driver.OracleDriver"
  8. url="jdbc:oracle:thin:@localhost:1521:orcl"
  9. scope="session" user="system" password="admin" />
  10.  
  11. <s:query var = "cust" dataSource="${ds}">
  12. select customerId,customerName,customerAddress,billAmount from customer
  13. </s:query>
  14.  
  15.  
  16. <table border=1>
  17. <c:forEach var="row" items="${cust.rows}">
  18. <tr>
  19. <td><c:out value="${row.customerId}"/></td>
  20. <td><c:out value="${row.customerName}"/></td>
  21. <td><c:out value="${row.customerAddress}"/></td>
  22. <td><c:out value="${row.billAmount}"/></td>
  23. </tr>
  24. </c:forEach>
  25. </table>
Add Comment
Please, Sign In to add comment