Java Mysql Error in a field

0

It does not let me change the default value of a field in the database that I have to use to do a job even if it is root, and above it gives me an error that a field has no default value, what do I do?

num_emp1.setText("" + rs.getDouble("num_emp"));

GuardaEmp = Double.parseDouble(num_emp1.getText());

private void AceptarActionPerformed(java.awt.event.ActionEvent evt) {

    try
    {
        sqlDate = new java.sql.Date(utilDate.getTime());
        tablaEmp.insertar(sqlDate, GuardaJefe, 
        nombre1.getText(),GuardaDpto,GuardaEmp,
        GuardaSalario,tarea1.getText());
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }
} 

When I finally added a default value I get the error of:

  

You have an error in your SQL syntax; check the manual that   corresponds to your MariaDB server version for the right syntax to use   near '' at line 1

and if I try to delete it from java I get this one:

  

Can not issue data manipulation statements with executeQuery ().

I do not know what to do.

    
asked by jesus 14.05.2018 в 09:59
source

1 answer

0

Ok I solved it, but now I get nullPointerException and I do not know why. and he gives it to me in the following line:

rs.updateDouble("num_emp", num_emp);

Apart from the insert button, I have checked in the database the. or the, and everything is fine and in its place I do not know what happens

    
answered by 14.05.2018 в 14:36