I'm building a wrapper for DB access using AWS' Lambda functions Java, the issue I'm having is that Lambda parameters are JSON, thus typeless, so all incoming params are de-JSON'd into Strings, and when adding them to a PreparedStatement using the setObject(param, value) method they all get treated as if you were using setString(param, value), this is fine for Strings and numbers, but when it comes to a parameter that is a timestamp or date, we get a parameter type mismatch like this:
org.postgresql.util.PSQLException: operator does not exist: timestamp with time zone >= character varying Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
I'm aware that passing parameter types as an extra field for the JSON might help, but I'm worried about both the extra overhead and, the need of manually adding the parameter type to the JSON, as it's currently being built "automagically" from the underlying DTO using GSON.
Can anyone figure out a different approach, perhaps on passing the parameters to the PreparedStatement.?