Skip to content

Commit

Permalink
New Feature
Browse files Browse the repository at this point in the history
  • Loading branch information
tsviz committed Jul 11, 2023
1 parent fb48f8d commit 68b03a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>5.7.0</version>
</dependency>

<!-- <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/net/codejava/SalesDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ public List<Sale> list() {
}

public void save(Sale sale) {
SimpleJdbcInsert insertActor = new SimpleJdbcInsert(jdbcTemplate);
insertActor.withTableName("sales").usingColumns("item", "quantity", "amount");
BeanPropertySqlParameterSource param = new BeanPropertySqlParameterSource(sale);

insertActor.execute(param);
String sql = "INSERT INTO SALES (item, quantity, amount) VALUES ('" + sale.getItem() + "', " + sale.getQuantity() + ", " + sale.getAmount() + ")";
jdbcTemplate.update(sql);

Check failure

Code scanning / CodeQL

Query built from user-controlled sources High

This query depends on a
user-provided value
.
}

public Sale get(int id) {
Expand Down

0 comments on commit 68b03a2

Please sign in to comment.