@@ -27,7 +27,7 @@ public class DatabaseExample {
27
27
public void updateTodayOrders(Connection connection, List<Order> orders) {
28
28
Date today = java.sql.Date.valueOf(LocalDate.now());
29
29
String insertQuery = "INSERT INTO Order (id, price, executionDate) VALUES (?, ?, ?)";
30
- PreparedStatement preparedStatement = connection.prepareStatement(SQL_INSERT );
30
+ PreparedStatement preparedStatement = connection.prepareStatement(insertQuery );
31
31
32
32
for(Order order: orders) {
33
33
preparedStatement.setString(1, order.id());
@@ -50,10 +50,9 @@ public class DatabaseExample {
50
50
public void updateTodayOrders(Connection connection, List<Order> orders) {
51
51
Date today = java.sql.Date.valueOf(LocalDate.now());
52
52
String insertQuery = "INSERT INTO Order (id, price, executionDate) VALUES (?, ?, ?)";
53
- preparedStatement.setDate(3, today); // Compliant
54
-
55
- PreparedStatement preparedStatement = connection.prepareStatement(SQL_INSERT);
53
+ PreparedStatement preparedStatement = connection.prepareStatement(insertQuery);
56
54
55
+ preparedStatement.setDate(3, today); // Compliant
57
56
for(Order order: orders) {
58
57
preparedStatement.setString(1, order.id());
59
58
preparedStatement.setString(2, order.price());
0 commit comments