Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. void updateClient(String id,String nimi,String osoite, String puhelin, String email) {
  2. try{
  3. Class.forName("com.mysql.jdbc.Driver");
  4. Connection con=DriverManager.getConnection(
  5. "jdbc:mysql://localhost:3306/yhteystiedot","root","");
  6. //here sonoo is database name, root is username and password
  7. Statement stmt=con.createStatement();
  8. stmt.executeUpdate("UPDATE asiakas SET nimi='" + nimi + "', osoite='"
  9. + osoite + "',puhelinnumero='" + puhelin + "',email='" + email + "'" +
  10. " WHERE asiakasid=" + id);
  11. con.close();
  12. }catch(Exception e){}
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement