Advertisement
mhdew

Untitled

Aug 20th, 2019
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. try{
  2. String sql="SELECT * FROM saturday where course = '?' and section ='?'";
  3. PreparedStatement ps=con.prepareStatement(sql);
  4. ps.setString(1, crs);
  5. ps.setString(2, se);
  6. ResultSet rs=ps.executeQuery();
  7.  
  8. while(rs.next())
  9. {
  10. String d = rs.getString("Day");
  11. String t = rs.getString("Time");
  12. String r = rs.getString("Room");
  13. String c = rs.getString("Course");
  14. String s = rs.getString("Section");
  15. String tc = rs.getString("Teacher");
  16.  
  17. model.addRow(new Object[]{d,t,r,c,s,tc});
  18. }
  19. table.setModel(model);
  20. }catch(Exception ex)
  21. {
  22. JOptionPane.showMessageDialog(null, ex);
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement