Guest User

Untitled

a guest
Jan 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public void cek(int port){
  2. try {
  3. Class.forName("com.mysql.jdbc.Driver");
  4. java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/jaringan","root","");
  5. java.sql.Statement st = con.createStatement();
  6. String query = "select * from port where id_port ="+port;
  7. ResultSet rs = st.executeQuery(query);
  8. rs.next();
  9. System.out.println(rs);
  10.  
  11. if(rs.next()==false){
  12. // tmbh();
  13. System.out.println("ugh");
  14. }
  15. else if(rs.getString(3) != null )
  16. {
  17. pc();
  18. }else if(rs.getString(2)!=null){
  19. sw1();
  20. }
  21. }catch(Exception e){
  22. System.out.println(e.getMessage());
  23. }
  24.  
  25.  
  26. }
Add Comment
Please, Sign In to add comment