Cita:
y el errorconectar cc = new conectar();
Connection cn = cc.conexion();
String serial, briga, problema, id;
id=text_id.getText();
serial = text_serial.getText();
briga=text_briga.getText();
problema = text_problema.getText();
try {
PreparedStatement pst = cn.prepareStatement(
"UPDATE garantia14"+
" SET serial = ? ," +
"brigadista = ? ," +
"problema = ? ," +
" WHERE id = ? ");
pst.setString(1, serial);
pst.setString(2, briga);
pst.setString(3, problema);
pst.setString(4, String.valueOf(id));
int n=pst.executeUpdate();
if(n>0){
JOptionPane.showMessageDialog(null,"Registro Guardado");
bloquear();
cargar("");
}
} catch (SQLException ex) {
Logger.getLogger(ingresar.class.getName()).log(Lev el.SEVERE, null, ex);
}
Connection cn = cc.conexion();
String serial, briga, problema, id;
id=text_id.getText();
serial = text_serial.getText();
briga=text_briga.getText();
problema = text_problema.getText();
try {
PreparedStatement pst = cn.prepareStatement(
"UPDATE garantia14"+
" SET serial = ? ," +
"brigadista = ? ," +
"problema = ? ," +
" WHERE id = ? ");
pst.setString(1, serial);
pst.setString(2, briga);
pst.setString(3, problema);
pst.setString(4, String.valueOf(id));
int n=pst.executeUpdate();
if(n>0){
JOptionPane.showMessageDialog(null,"Registro Guardado");
bloquear();
cargar("");
}
} catch (SQLException ex) {
Logger.getLogger(ingresar.class.getName()).log(Lev el.SEVERE, null, ex);
}
Cita:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorEx ception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id = '2'' at line 1
alguien me puede ayudar cualquier información extra no duden en pedirla.
gracias.