Guest User

Untitled

a guest
Aug 5th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. Class.forName("com.mysql.jdbc.Driver");
  2. conectar = (Connection) DriverManager.getConnection("jdbc:mysql://127.0.0.1/proyecto", "root", "");
  3.  
  4. pst.setString(1, jTextField1.getText());
  5. pst.setString(2, jTextField2.getText());
  6. pst.setString(3, jTextField3.getText());
  7. pst.setString(4, jTextField4.getText());
  8. pst.setString(5, jTextField5.getText());
  9. pst.setString(6, jTextField6.getText());
  10. pst.setString(7, jTextField8.getText());
  11. FileInputStream ArchivosFoto;
  12. FileInputStream Archivofoto = new FileInputStream(jTextField7.getText());
  13. pst.setBinaryStream(8, Archivofoto);
  14. pst.setString(9, jTextField7.getText());
  15. int n = pst.executeUpdate();
  16. if (n > 0) {
  17. JOptionPane.showMessageDialog(null, "Se modificaron los datos de manera correcta :D");
  18. tablaDatos();
  19.  
  20. } else {
  21.  
  22. JOptionPane.showMessageDialog(null, "Ocurrio un error, no se pudo modificar los datos :c");
  23.  
  24. }
Add Comment
Please, Sign In to add comment