{"record":{"id":"b8886ff4d5025afd","repo":"prestodb/presto","slug":"getncharacterstream","errorCode":null,"errorMessage":"getNCharacterStream","messagePattern":"getNCharacterStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1412,"sourceCode":"    @Override\n    public String getNString(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getNString\");\n    }\n\n    @Override\n    public String getNString(String columnLabel)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getNString\");\n    }\n\n    @Override\n    public Reader getNCharacterStream(int columnIndex)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getNCharacterStream\");\n    }\n\n    @Override\n    public Reader getNCharacterStream(String columnLabel)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"getNCharacterStream\");\n    }\n\n    @Override\n    public void updateNCharacterStream(int columnIndex, Reader x, long length)\n            throws SQLException\n    {\n        throw new SQLFeatureNotSupportedException(\"updateNCharacterStream\");\n    }\n\n    @Override\n    public void updateNCharacterStream(String columnLabel, Reader reader, long length)","sourceCodeStart":1394,"sourceCodeEnd":1430,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1394-L1430","documentation":"PrestoResultSet.getNCharacterStream(int) is a JDBC 4 national-character stream accessor that Presto's driver intentionally does not support; it throws SQLFeatureNotSupportedException naming the method. Presto has no NCHAR-family SQL types, so no character-stream implementation exists.","triggerScenarios":"Calling getNCharacterStream(int columnIndex) on a Presto result set. Throws unconditionally on every invocation.","commonSituations":"Generic JDBC tooling or code ported from databases with national character types; readers streaming large text columns assuming JDBC 4 N-stream APIs are available.","solutions":["Use getCharacterStream(int columnIndex) if a stream is needed, or getString for the full text","Refactor the data-access layer to the standard character APIs supported by Presto","Check driver capability (DatabaseMetaData) before calling JDBC 4-only methods"],"exampleFix":"// before\nReader r = rs.getNCharacterStream(3);\n// after\nReader r = rs.getCharacterStream(3);","handlingStrategy":"try-catch","validationCode":"if (conn.getMetaData().getDatabaseProductName().contains(\"Presto\")) {\n    useStandardCharStream = true;\n}","typeGuard":"boolean supportsNCharStream(ResultSet rs) {\n    return !(rs instanceof com.facebook.presto.jdbc.PrestoResultSet);\n}","tryCatchPattern":"try {\n    reader = rs.getNCharacterStream(3);\n} catch (SQLFeatureNotSupportedException e) {\n    reader = rs.getCharacterStream(3);\n}","preventionTips":["Prefer getCharacterStream over getNCharacterStream for all Presto reads","Audit JDBC 4 usage in shared mappers against Presto's supported subset","Feature-detect via DatabaseMetaData before calling N* stream APIs"],"tags":["jdbc","unsupported-feature","presto"],"backgroundTag":"unsupported-jdbc-feature","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"}