Guest User

Untitled

a guest
Jan 1st, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. try
  2. {Class.forName("java.sql.DriverManager");
  3. Connection con=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/bleh","root","root");
  4. Statement stmt=con.createStatement();
  5. String qry="select * from admin;";
  6. ResultSet rs=stmt.executeQuery(qry);
  7. int i=0;
  8. while(rs.next())
  9. {
  10. i++;
  11. }
  12. if(i==0)
  13. {
  14. this.setVisible(false);
  15. new start().setVisible(true);
  16. }
  17. else if(i>0)
  18. {
  19. this.setVisible(false);
  20. new login().setVisible(true);
  21. }
  22. }
  23. catch(Exception e)
  24. {
  25. JOptionPane.showMessageDialog(null,e.getMessage());
  26. e.printStackTrace();
  27. }
  28.  
  29. {
  30. }
Add Comment
Please, Sign In to add comment