Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. <%@page contentType="text/html" pageEncoding="UTF-8" %>
  2. <%@Page import="java.sql.*;" %>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>Admin Reporting</title>
  7. </head>
  8. <body>
  9. <center>
  10. <h2 align="center">Order Report</h2>
  11. <table border="0" width="90%">
  12. <form action=OrderController method="POST">
  13. <tbody>
  14. <td class="label">Branch Number</td>
  15. <td class="text" width="25%">
  16. <select>
  17. <option selected value="0">All Branches</option>
  18. <%
  19. try
  20. {
  21. String Query = " SELECT DISTINCT BRANCH_NUMBER FROM BRANCH";
  22. Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
  23. Connection conn = DriverManager.getConnection("jdbc:db2://XXXX:100001/XXXX","XXXX","YYYY");
  24. Statement stm=conn.createStatement();
  25. ResultSet rs = stm.executeQuerey(Query);
  26. while(rs.next())
  27. {
  28. %>
  29. <option value="<%=rs.getint("BranchId")%>"><%=rs.getString("Branch_Number")%></option>
  30. <%
  31. }
  32.  
  33. }catch(Exception ex)
  34. {
  35. ex.printStackTrace();
  36. }
  37. %>
  38. </select>
  39. <tr>
  40. <td></td>
  41. <td align="center">
  42. <button type="submit" name="submit" value="submit">Submit</button>
  43. </td>
  44. <td></td>
  45. </tr>
  46. </form>
  47. </tbody>
  48. </table>
  49. </center>
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement