Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. <%@ page import="java.io.*,java.util.*,java.sql.*"%>
  2. <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
  5. <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
  6. <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
  7. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. <title>Product Database With Updates</title>
  13. </head>
  14. <body>
  15. <h1>Products from Database</h1>
  16. <sql:setDataSource var="snapshot" driver="org.apache.derby.jdbc.ClientDriver"
  17. url="jdbc:derby://localhost:1527/myDatabase"
  18. user="mis320" password="mis320"/>
  19.  
  20. <sql:query dataSource="${snapshot}" var="result">
  21. SELECT * from Product
  22. </sql:query>
  23.  
  24. <table border="1" width="100%">
  25. <tr>
  26. <th>Order Number</th>
  27. <th>Customer ID</th>
  28. <th>Product ID</th>
  29. <th>Quantity</th>
  30. <th>Shipping Cost</th>
  31. <th>Sales Date</th>
  32. <th>Shipping Date</th>
  33.  
  34. </tr>
  35. <c:forEach var="row" items="${result.rows}">
  36. <tr>
  37. <td><c:out value="${row.ORDER_NUM}"/></td>
  38. <td><c:out value="${row.CUSTOMER_ID}"/></td>
  39. <td><c:out value="${row.PRODUCT_ID}"/></td>
  40. <td><c:out value="${row.QUANTITY}"/></td>
  41. <td><c:out value="${row.SHIPPING_COST}"/></td>
  42. <td><c:out value="${row.SALES_DATE}"/></td>
  43. <td><c:out value="${row.SHIPPING_DATE}"/></td>
  44.  
  45. </tr>
  46. </c:forEach>
  47. </table>
  48. <html:form action="/update" method="get">
  49.  
  50. Product ID To Update:
  51. <html:text property="productID" size="50" /><br><br>
  52.  
  53. New Order Number:
  54. <html:text property="orderNumber" size="50" /><br><br>
  55. New Customer ID:
  56. <html:text property="customerID" size="50" /><br><br>
  57. New Quantity:
  58. <html:text property="quantity" size="30" /><br><br>
  59. New Shipping Cost:
  60. <html:text property="shippingCost" size="30" /><br><br>
  61. New Sales Date (YYYY-MM-DD):
  62. <html:text property="salesDate" size="30" /><br><br>
  63. New Shipping Date (YYYY-MM-DD):
  64. <html:text property="shippingDate" size="30" /><br><br>
  65.  
  66. <html:submit>Update</html:submit>
  67. <br><br>
  68. </html:form>
  69.  
  70. <html:form action="/delete" method="get">
  71.  
  72. Product ID To Delete:
  73. <html:text property="productID" size="50" /><br><br>
  74.  
  75. <html:submit>Delete</html:submit>
  76. <br><br>
  77. </html:form>
  78.  
  79. </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement