Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
scmacdon authored Oct 28, 2022
1 parent 56c8417 commit c0d7bae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions javav2/usecases/CreatingSpringRedshiftRest/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ The following Java code represents the **WorkItemRepository** class. Notice that
In addition, notice the use of [Class SqlParameter](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/services/redshiftdata/model/SqlParameter.html) when using SQL statements. For example, in the **getData** method, you build a list of **SqlParameter** objects used to get records from the database.

```java

package com.aws.rest;

import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -484,14 +485,14 @@ public class WorkItemRepository {

// Get all records from the Amazon Redshift table.
if (arch.compareTo("") == 0) {
sqlStatement = "SELECT idwork, date, description, guide, status, username FROM work";
sqlStatement = "SELECT idwork, date, description, guide, status, username, archive FROM work";
ExecuteStatementResponse response = executeAll(sqlStatement);
String id = response.id();
System.out.println("The identifier of the statement is "+id);
checkStatement(id);
return getResults(id);
} else {
sqlStatement = "SELECT idwork, date, description, guide, status, username " +
sqlStatement = "SELECT idwork, date, description, guide, status, username, archive " +
"FROM work WHERE username = :username and archive = :arch ;";

parameters = List.of(
Expand Down Expand Up @@ -608,8 +609,6 @@ public class WorkItemRepository {
flipItemArchive(sqlStatement,parameters);
}



public String injectNewSubmission(WorkItem item) {
try {
String name = item.getName();
Expand Down Expand Up @@ -648,6 +647,7 @@ public class WorkItemRepository {
}
}


```

### WorkItem class
Expand Down

0 comments on commit c0d7bae

Please sign in to comment.