Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page import="java.io.*,java.util.*,java.sql.*"%>
- <%@ page import="javax.servlet.http.*,javax.servlet.*" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
- <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
- <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Product Database With Updates</title>
- </head>
- <body>
- <h1>Products from Database</h1>
- <sql:setDataSource var="snapshot" driver="org.apache.derby.jdbc.ClientDriver"
- url="jdbc:derby://localhost:1527/myDatabase"
- user="mis320" password="mis320"/>
- <sql:query dataSource="${snapshot}" var="result">
- SELECT * from Product
- </sql:query>
- <table border="1" width="100%">
- <tr>
- <th>Order Number</th>
- <th>Customer ID</th>
- <th>Product ID</th>
- <th>Quantity</th>
- <th>Shipping Cost</th>
- <th>Sales Date</th>
- <th>Shipping Date</th>
- </tr>
- <c:forEach var="row" items="${result.rows}">
- <tr>
- <td><c:out value="${row.ORDER_NUM}"/></td>
- <td><c:out value="${row.CUSTOMER_ID}"/></td>
- <td><c:out value="${row.PRODUCT_ID}"/></td>
- <td><c:out value="${row.QUANTITY}"/></td>
- <td><c:out value="${row.SHIPPING_COST}"/></td>
- <td><c:out value="${row.SALES_DATE}"/></td>
- <td><c:out value="${row.SHIPPING_DATE}"/></td>
- </tr>
- </c:forEach>
- </table>
- <html:form action="/update" method="get">
- Product ID To Update:
- <html:text property="productID" size="50" /><br><br>
- New Order Number:
- <html:text property="orderNumber" size="50" /><br><br>
- New Customer ID:
- <html:text property="customerID" size="50" /><br><br>
- New Quantity:
- <html:text property="quantity" size="30" /><br><br>
- New Shipping Cost:
- <html:text property="shippingCost" size="30" /><br><br>
- New Sales Date (YYYY-MM-DD):
- <html:text property="salesDate" size="30" /><br><br>
- New Shipping Date (YYYY-MM-DD):
- <html:text property="shippingDate" size="30" /><br><br>
- <html:submit>Update</html:submit>
- <br><br>
- </html:form>
- <html:form action="/delete" method="get">
- Product ID To Delete:
- <html:text property="productID" size="50" /><br><br>
- <html:submit>Delete</html:submit>
- <br><br>
- </html:form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement