Tracking down weird errors with database PreparedStatements

removing the quotes fixed part of the issue. The second part was hidden by that.

GRANT USAGE, SELECT ON SEQUENCE <sequence_name> TO <user>;

fixed the other part.

thanks all for your help.
sb