Switch to millis for times

There are issues with the serialization of the time objects since the constructors are not public. Passing times around in milliseconds avoid them.
This commit is contained in:
NMerz
2020-10-06 21:39:23 -04:00
parent 68051fdaca
commit 56c9a3f99d
6 changed files with 25 additions and 26 deletions

View File

@@ -10,9 +10,9 @@ public class ItemSearcher implements CallHandler {
DBConnector connector;
String cognitoID;
private final String GET_ITEM_MATCHES = "SELECT * FROM Product WHERE description LIKE %?%";
private final String GET_ITEM_MATCHES = "SELECT * FROM Product WHERE description LIKE ?";
ItemSearcher(DBConnector connector, String cognitoID) {
public ItemSearcher(DBConnector connector, String cognitoID) {
this.connector = connector;
this.cognitoID = cognitoID;
}
@@ -21,7 +21,7 @@ public class ItemSearcher implements CallHandler {
public Object conductAction(Map<String, Object> body, HashMap<String, String> queryParams, String s) throws SQLException {
try (Connection connection = connector.getConnection()) {
PreparedStatement getItemMatches = connection.prepareStatement(GET_ITEM_MATCHES);
getItemMatches.setString(1, queryParams.get("id"));
getItemMatches.setString(1, "%" + queryParams.get("id") + "%");
System.out.println(getItemMatches);
ResultSet searchResults = getItemMatches.executeQuery();
ItemSearch searchResultsObject = new ItemSearch(searchResults);