Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. Connection connection1 = null;
  2. PreparedStatement ps1 = null;
  3. ResultSet rs3 = null;
  4.  
  5. Connection connection3 = null;
  6. PreparedStatement ps3 = null;
  7. ResultSet rs4 = null;
  8.  
  9. try {
  10. Class.forName("com.mysql.jdbc.Driver");
  11. connection1 = DriverManager.getConnection("jdbc:mysql://localhost:3306/beautysalon?" + "user=root&password=thiva");
  12. System.out.println("connected");
  13.  
  14. ps1 = connection1.prepareStatement("SELECT image FROM colour WHERE Date ='" + tbl_click + "'");
  15. rs3 = ps1.executeQuery();
  16. System.out.println("z" + " " + rs3);
  17. byte b[] = null;
  18.  
  19. while (rs3.next()) {
  20. b = rs3.getBytes(1);
  21.  
  22. jLabel18.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(b)));
  23. }
  24.  
  25. try {
  26. Class.forName("com.mysql.jdbc.Driver");
  27. connection3 = DriverManager.getConnection("jdbc:mysql://localhost:3306/beautysalon?" + "user=root&password=thiva");
  28. System.out.println("connected1");
  29.  
  30. ps3 = connection3.prepareStatement("SELECT aftimg FROM colour WHERE Date ='" + tbl_click + "'");
  31. rs4 = ps3.executeQuery();
  32. System.out.println("y" + " " + rs4);
  33. byte c[] = null;
  34. while (rs4.next()) {
  35. c = rs4.getBytes(1);
  36. jLabel14.setIcon(new ImageIcon(Toolkit.getDefaultToolkit().createImage(c)));
  37. }
  38. } catch (Exception e) {
  39.  
  40. }
  41.  
  42. } catch (Exception e) {
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement