Skip to content

Commit

Permalink
jd03_07 fixed price double
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel3423 committed Mar 13, 2018
1 parent 204c7d4 commit 18a79a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/by/it/kozlov/project/java/dao/dao/CarDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public Car read(int id) throws SQLException {
public boolean update(Car car) throws SQLException {
try (Connection connection = ConnectionCreator.getConnection();
Statement statement = connection.createStatement()) {
String sql = String.format("UPDATE `kozlov`.`cars` SET `brandID`='%d',`model`='%s',`carClass`='%s',`price`='%G',`year`='%d',`usersID`='%d' WHERE id=%d",
String sql = String.format(new Locale("en", "US"), "UPDATE `kozlov`.`cars` SET `brandID`='%d',`model`='%s',`carClass`='%s',`price`='%G',`year`='%d',`usersID`='%d' WHERE id=%d",
car.getBrandID(), car.getModel(), car.getCarClass(), car.getPrice(), car.getYear(), car.getUsersID(), car.getId());
int count = statement.executeUpdate(sql);
return count == 1;
Expand Down

0 comments on commit 18a79a1

Please sign in to comment.