-1
我正在寻找这个问题的解决方案,但我找不到它。我什么都试过,他们在论坛上说,但没有对我的作品操作数应该包含1列插入
public boolean ingresarEntrada(String pl, String fech, String hora,String tipo){
ConexionBD sql=new ConexionBD();
Connection cn = sql.Conectar();
String query= "insert into datos(serie, placa, fecha, hora_entrada, hora_salida, tipo, transcurrido, total)"
+ "values((NULL, '"+pl+"', '"+fech+"', '"+hora+"', '', '"+tipo+"', '', ''))";
String mensaje="Datos ingresados correctamente";
try {
sql.stmt.executeUpdate(query);
} catch (SQLException ex) {
JOptionPane.showMessageDialog(null,ex);
return false;
}
return true;
}
日志会在这里超级有帮助 – UDKOX
'total'后缺少空格' – Berger
此外,大的建议,使用SQL查询中的'PreparedStatement'。 – UDKOX