Guest User

Untitled

a guest
Jun 30th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. JList listTime = new JList();
  2. listTime.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  3. listTime.setFont(new Font("Times New Roman", Font.PLAIN, 25));
  4. listTime.setBounds(329, 311, 200, 50);
  5. frame.getContentPane().add(listTime);
  6. try {
  7. Class.forName("com.mysql.jdbc.Driver");
  8. Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/suhel","root","Suhel786");
  9. Statement stmt = con.createStatement();
  10. String sql="select distinct time from tbmovie where movie='"+select_mov+"'";
  11. ResultSet rs = stmt.executeQuery(sql);
  12. while(rs.next())
  13. {
  14. listTime.add(rs.getString("time"));//here is the Error
  15. }
  16.  
  17. }
  18. catch(Exception e1){
  19. System.out.print(e1);
  20. }
Add Comment
Please, Sign In to add comment