Advertisement
Guest User

Untitled

a guest
May 5th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. try {
  2.  
  3. String host ="jdbc:derby://localhost:1527/UserData";
  4. String DBusername="mohammad";
  5. String DBpassword="0598087382";
  6. String userName=lblApplicantName.getText();
  7. Connection cn = DriverManager.getConnection(host,DBusername, DBpassword);
  8. String command ="UPDATE MOHAMMAD.USERTABLE SET ISACCEPTED =TRUE WHERE USERNAME='"+userName+"'";
  9. Statement stmt =cn.createStatement();
  10. stmt.execute(command);
  11. stmt.close();
  12. cn.close();
  13.  
  14. logIN.cellNo[cellIndex]=0;
  15. cellIndex++;}
  16.  
  17.  
  18. catch (SQLException e) {
  19. JOptionPane.showMessageDialog(null, e.getMessage(),"can't connect to DataBase",0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement