Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@page contentType="text/html" pageEncoding="UTF-8" %>
- <%@Page import="java.sql.*;" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Admin Reporting</title>
- </head>
- <body>
- <center>
- <h2 align="center">Order Report</h2>
- <table border="0" width="90%">
- <form action=OrderController method="POST">
- <tbody>
- <td class="label">Branch Number</td>
- <td class="text" width="25%">
- <select>
- <option selected value="0">All Branches</option>
- <%
- try
- {
- String Query = " SELECT DISTINCT BRANCH_NUMBER FROM BRANCH";
- Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
- Connection conn = DriverManager.getConnection("jdbc:db2://XXXX:100001/XXXX","XXXX","YYYY");
- Statement stm=conn.createStatement();
- ResultSet rs = stm.executeQuerey(Query);
- while(rs.next())
- {
- %>
- <option value="<%=rs.getint("BranchId")%>"><%=rs.getString("Branch_Number")%></option>
- <%
- }
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- %>
- </select>
- <tr>
- <td></td>
- <td align="center">
- <button type="submit" name="submit" value="submit">Submit</button>
- </td>
- <td></td>
- </tr>
- </form>
- </tbody>
- </table>
- </center>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement