{"record":{"id":"2d0f0119c99ba69d","repo":"prestodb/presto","slug":"setnclob","errorCode":null,"errorMessage":"setNClob","messagePattern":"setNClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"warning","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java","lineNumber":589,"sourceCode":"    @Override\n    public void setNString(int parameterIndex, String value)\n            throws SQLException\n    {\n        setString(parameterIndex, value);\n    }\n\n    @Override\n    public void setNCharacterStream(int parameterIndex, Reader value, long length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setNCharacterStream\");\n    }\n\n    @Override\n    public void setNClob(int parameterIndex, NClob value)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setNClob\");\n    }\n\n    @Override\n    public void setClob(int parameterIndex, Reader reader, long length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setClob\");\n    }\n\n    @Override\n    public void setBlob(int parameterIndex, InputStream inputStream, long length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"setBlob\");\n    }\n\n    @Override\n    public void setNClob(int parameterIndex, Reader reader, long length)","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoPreparedStatement.java#L571-L607","documentation":"PrestoPreparedStatement.setNClob(int, NClob) is a stub throwing SQLFeatureNotSupportedException. The Presto JDBC driver does not support NClob locators or national-character large-object binding. Large text must be streamed or bound as a string using the non-N APIs.","triggerScenarios":"Calling PreparedStatement.setNClob(int parameterIndex, java.sql.NClob value) on a PrestoPreparedStatement; frameworks that wrap large text in NClob objects before binding.","commonSituations":"Code migrated from Oracle/SQL Server where NCLOB columns are common; generic JDBC exporters that wrap CLOB/NCLOB values for cross-database copies.","solutions":["Use setClob(int, Clob) or setCharacterStream for large text","Bind the value with setString when the text fits in memory","Strip the NClob wrapper and pass the underlying string/reader"],"exampleFix":"// before\npstmt.setNClob(1, nclob);\n// after\npstmt.setString(1, nclob.getSubString(1, (int) nclob.length()));","handlingStrategy":"fallback","validationCode":"if (value instanceof java.sql.NClob) { pstmt.setString(parameterIndex, ((java.sql.NClob) value).getSubString(1, (int) ((java.sql.NClob) value).length())); }","typeGuard":"boolean isLocatorType(Object v) { return v instanceof java.sql.NClob || v instanceof java.sql.Clob || v instanceof java.sql.Blob || v instanceof java.sql.SQLXML; }","tryCatchPattern":"try { pstmt.setNClob(idx, nclob); } catch (SQLFeatureNotSupportedException e) { pstmt.setString(idx, nclob.getSubString(1, (int) nclob.length())); }","preventionTips":["Do not wrap Presto text values in NClob objects","Unwrap LOB locators to strings/readers before binding","Map Presto VARCHAR columns to plain String bindings in the ORM"],"tags":["jdbc","unsupported-feature","lob"],"backgroundTag":"sqlfeaturenotsupported","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"}