{"record":{"id":"f6e26854e5a297e7","repo":"prestodb/presto","slug":"createnclob","errorCode":null,"errorMessage":"createNClob","messagePattern":"createNClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java","lineNumber":519,"sourceCode":"    @Override\n    public Clob createClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createClob\");\n    }\n\n    @Override\n    public Blob createBlob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createBlob\");\n    }\n\n    @Override\n    public NClob createNClob()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createNClob\");\n    }\n\n    @Override\n    public SQLXML createSQLXML()\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"createSQLXML\");\n    }\n\n    @Override\n    public boolean isValid(int timeout)\n            throws SQLException\n    {\n        if (timeout < 0) {\n            throw new SQLException(\"Timeout is negative\");\n        }\n        return !isClosed();\n    }","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoConnection.java#L501-L537","documentation":"PrestoConnection.createNClob() unconditionally throws SQLFeatureNotSupportedException(\"createNClob\"). National-character-set Clob objects (NClob) are not implemented by the driver; the method is a stub that always fails. Presto treats all text as UTF-8 VARCHAR, so NClob has no server-side counterpart.","triggerScenarios":"Calling connection.createNClob(), or code paths that bind NCHAR/NVARCHAR parameters via setNClob using a created NClob.","commonSituations":"Migrating from SQL Server/Oracle where NClob is required for Unicode text; generic JDBC layers that distinguish Clob vs NClob types.","solutions":["Use setString/getString instead of NClob — Presto VARCHAR is already UTF-8","Drop NClob-specific branches in generic data-binding code","Fall back to string binding when SQLFeatureNotSupportedException is caught"],"exampleFix":"// before\nNClob nclob = connection.createNClob();\nnclob.setString(1, unicodeText);\nps.setNClob(1, nclob);\n// after\nps.setString(1, unicodeText);","handlingStrategy":"try-catch","validationCode":"DatabaseMetaData meta = connection.getMetaData();\nif (meta.getDriverName().contains(\"Presto\")) {\n    // driver does not support createNClob — Presto text is UTF-8 VARCHAR\n}","typeGuard":"static boolean supportsClientNClob(DatabaseMetaData meta) throws SQLException {\n    return !meta.getDriverName().contains(\"Presto\");\n}","tryCatchPattern":"try {\n    NClob nclob = connection.createNClob();\n    // ... use nclob\n} catch (SQLFeatureNotSupportedException e) {\n    // fall back: ps.setString(...) for Unicode text\n}","preventionTips":["Treat all Presto text as UTF-8 VARCHAR; skip NCHAR/NVARCHAR-specific paths","Remove NClob branches from generic JDBC helpers when targeting Presto","Bind Unicode text with setString and verify in integration tests"],"tags":["jdbc","presto","unsupported-operation","nclob"],"backgroundTag":"sql-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"}