public void DbInsertLoginCar(List<LoginCar> list) throws SQLException { Iterator<LoginCar> iter = list.iterator(); LoginCar lc = new LoginCar(); while (iter.hasNext()) { lc = iter.next(); String sql = "insert into CarInfo values(" + lc.getLoginId() + "," + lc.getCarId() + ");"; state.executeUpdate(sql); } }
public int DbInsertLoginCar(LoginCar lc) throws SQLException { String sql = "insert into CarInfo values(" + lc.getLoginId() + "," + lc.getCarId() + ");"; return state.executeUpdate(sql); }