-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