good I have two tables a user and another type of user which are related I would like to save the data in java mysql netbeans that when entering the data in user they load me in type of user to give the level or privilege in the system I did an essay because of versad I am new to this and this is part of the university project, I made a sentence but it gave me the following, this is the sentence:
try {
PreparedStatement ap=con.prepareStatement("INSERT INTO tipo_usuario(regente,almacenista,auxiliar) VALUES(?,?,?)");
ap.setInt(1, cbtipo_usuario.getSelectedIndex());
ap.setInt(2, cbtipo_usuario.getSelectedIndex());
ap.setInt(3, cbtipo_usuario.getSelectedIndex());
ap.executeUpdate();
PreparedStatement pps = con.prepareStatement("INSERT INTO usuario (usuario,contraseña,nombre,apellido,nacio,cedula,telefono,sexo,direccion,tipo_usuario) VALUES(?,?,?,?,?,?,?,?,?,?)");
pps.setString(1, txtusu.getText());
pps.setString(2, contra.getText().toString());
pps.setString(3, txtnombre.getText());
pps.setString(4, txtapellido.getText());
pps.setString(5, cbnacion.getSelectedItem().toString());
pps.setString(6, txtcedul.getText());
pps.setString(7, cbsexo.getSelectedItem().toString());
pps.setString(8, cbope.getSelectedItem().toString() + "" + txttelf.getText());
pps.setString(9, txtdireccion.getText());
pps.setInt(10, cbtipo_usuario.getSelectedIndex());
pps.executeUpdate();
JOptionPane.showMessageDialog(null, "DATOS REGISTRADOS");
but running gives me the following error: Error here: java.sql.SQLException: The field 'user_type_type_user_type' does not have a default value
How can I fix it or do it thanks to the person who can help me a thousand thanks in advance