Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1.  
  2.  
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <title>PayRoll</title>
  7. </head>
  8. <body>
  9.  
  10. <%@ page import="java.sql.*" %>
  11. <%@ page import="java.io.*" %>
  12. <%@ page import="java.util.*" %>
  13. <%@ page import="java.*" %>
  14.  
  15.  
  16. <h1 align="center">Pay Roll</h1>
  17. <div>
  18.  
  19. Month: <select name="month">
  20. <option value="select" selected>--Select--</option>
  21. <option>JAN</option>
  22. <option>FEB</option>
  23. <option>MAR</option>
  24. <option>APR</option>
  25. <option>MAY</option>
  26. <option>JUN</option>
  27. <option>JUL</option>
  28. <option>AUG</option>
  29. <option>SEP</option>
  30. <option>OCT</option>
  31. <option>NOV</option>
  32. <option>DEC</option>
  33.  
  34. </select>
  35.  
  36. Year : <input type="text"/>
  37. <br/><br/><br/><br/><br/>
  38. Employee Code:<select name="empcode">
  39. <option value="select" selected >--Select--</option>
  40. <%
  41.  
  42. Connection con = null;
  43. try
  44. {
  45. Class.forName("com.mysql.jdbc.Driver").newInstance();
  46.  
  47. con= DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/payroll","root","");
  48.  
  49. }
  50. catch(Exception e){
  51. System.out.println(e.getMessage());
  52. }
  53.  
  54. String sqlString = "SELECT * from employee";
  55. Statement stmt = con.createStatement();
  56. ResultSet rs = stmt.executeQuery("SELECT * from employee");
  57.  
  58.  
  59.  
  60.  
  61. while ( rs.next() ) {
  62. out.println( rs.getString("code"));
  63. }
  64. rs.close();
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. %>
  73. </select>
  74. </div>
  75. </body>
  76. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement