Advertisement
Guest User

Untitled

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