{"record":{"id":"453bbb7ead22f08c","repo":"prestodb/presto","slug":"not-implemented-preparedstatement-settimestamp","errorCode":null,"errorMessage":"Not implemented: PreparedStatement.setTimestamp","messagePattern":"Not implemented: PreparedStatement\\.setTimestamp","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":540,"sourceCode":"    @Override\n    public void setDate(int parameterIndex, Date x, Calendar cal)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"setDate\");\n    }\n\n    @Override\n    public void setTime(int parameterIndex, Time x, Calendar cal)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"setTime\");\n    }\n\n    @Override\n    public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)\n            throws SQLException\n    {\n        throw new NotImplementedException(\"PreparedStatement\", \"setTimestamp\");\n    }\n\n    @Override\n    public void setNull(int parameterIndex, int sqlType, String typeName)\n            throws SQLException\n    {\n        setNull(parameterIndex, sqlType);\n    }\n\n    @Override\n    public void setURL(int parameterIndex, URL x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setURL\");\n    }\n\n    @Override\n    public ParameterMetaData getParameterMetaData()","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L522-L558","documentation":"setTimestamp(int, Timestamp, Calendar) — the Calendar-aware TIMESTAMP binding — is not implemented in the Presto JDBC driver and throws NotImplementedException. Only the two-argument setTimestamp is supported.","triggerScenarios":"Calling PreparedStatement.setTimestamp(parameterIndex, Timestamp, Calendar) on a Presto connection.","commonSituations":"Ported enterprise code that uses Calendar overloads to pin timestamps to a business timezone.","solutions":["Use the two-argument setTimestamp(parameterIndex, Timestamp).","Pre-convert the instant to the target timezone and bind with the simple overload.","Set the connection/session timezone so default conversions match expectations."],"exampleFix":"// before\nps.setTimestamp(1, ts, cal);\n// after\nps.setTimestamp(1, ts);","handlingStrategy":"fallback","validationCode":"if (cal != null) { /* pre-convert the Timestamp yourself and call the 2-arg setTimestamp */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the two-argument setTimestamp overload","Control session timezone via connection properties instead of Calendar","Add driver-compatibility unit tests for Calendar-based overloads when porting code"],"tags":["jdbc","presto","unimplemented","timezone"],"backgroundTag":"jdbc-feature-not-implemented","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}