{"record":{"id":"fc87e53e7e026689","repo":"prestodb/presto","slug":"setclob","errorCode":null,"errorMessage":"setClob","messagePattern":"setClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":503,"sourceCode":"    @Override\n    public void setRef(int parameterIndex, Ref x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setRef\");\n    }\n\n    @Override\n    public void setBlob(int parameterIndex, Blob x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setBlob\");\n    }\n\n    @Override\n    public void setClob(int parameterIndex, Clob x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setClob\");\n    }\n\n    @Override\n    public void setArray(int parameterIndex, Array x)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setArray\");\n    }\n\n    @Override\n    public ResultSetMetaData getMetaData()\n            throws SQLException\n    {\n        try (Statement statement = connection().createStatement(); ResultSet resultSet = statement.executeQuery(\"DESCRIBE OUTPUT \" + statementName)) {\n            return new PrestoResultSetMetaData(getDescribeOutputColumnInfoList(resultSet));\n        }\n    }\n","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L485-L521","documentation":"setClob is unconditionally unsupported in PrestoPreparedStatement: any call throws SQLFeatureNotSupportedException. The driver cannot accept java.sql.Clob handles; character large values must be passed as String via setString.","triggerScenarios":"Calling PreparedStatement.setClob(int, Clob) on a Presto connection.","commonSituations":"Porting large-text handling code from Oracle/MySQL that uses Clob for text columns.","solutions":["Convert the Clob to a String (clob.getSubString(1, (int) clob.length())) and call setString.","For very large text, read the Clob's character stream into a String then setString.","Avoid Clob entirely in code targeting Presto."],"exampleFix":"// before\nps.setClob(1, clob);\n// after\nps.setString(1, clob.getSubString(1, (int) clob.length()));","handlingStrategy":"fallback","validationCode":"if (x instanceof java.sql.Clob) { ps.setString(1, x.getSubString(1, (int) x.length())); return; }","typeGuard":null,"tryCatchPattern":"try { ps.setClob(1, clob); } catch (SQLFeatureNotSupportedException e) { ps.setString(1, clob.getSubString(1, (int) clob.length())); }","preventionTips":["Bind large text with setString(varchar)","Avoid java.sql.Clob in code targeting Presto","Centralize parameter binding so unsupported setters are replaced once"],"tags":["jdbc","presto","unsupported-feature"],"backgroundTag":"jdbc-feature-not-supported","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"}