{"record":{"id":"0dacaf72ffd64223","repo":"apache/shardingsphere","slug":"setncharacterstream","errorCode":null,"errorMessage":"setNCharacterStream","messagePattern":"setNCharacterStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationPreparedStatement.java","lineNumber":69,"sourceCode":"    \n    @Override\n    public final void setNClob(final int parameterIndex, final NClob x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setNClob\");\n    }\n    \n    @Override\n    public final void setNClob(final int parameterIndex, final Reader x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setNClob\");\n    }\n    \n    @Override\n    public final void setNClob(final int parameterIndex, final Reader x, final long length) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setNClob\");\n    }\n    \n    @Override\n    public final void setNCharacterStream(final int parameterIndex, final Reader x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setNCharacterStream\");\n    }\n    \n    @Override\n    public final void setNCharacterStream(final int parameterIndex, final Reader x, final long length) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setNCharacterStream\");\n    }\n    \n    @Override\n    public final void setRowId(final int parameterIndex, final RowId x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setRowId\");\n    }\n    \n    @Override\n    public final void setRef(final int parameterIndex, final Ref x) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"setRef\");\n    }\n    \n    @Override","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationPreparedStatement.java#L51-L87","documentation":"SQLFeatureNotSupportedException('setNCharacterStream') thrown by AbstractUnsupportedOperationPreparedStatement.setNCharacterStream(int, Reader). The national-character streaming bind is not part of ShardingSphere's parameter pipeline; it forwards only the standard setCharacterStream family to routed backend statements, so this final method always throws.","triggerScenarios":"ps.setNCharacterStream(1, reader) on a ShardingSphere PreparedStatement; usually generic code that chooses the N-variant for any Reader, or explicit NCHAR streaming for Oracle/SQL Server schemas.","commonSituations":"Unicode text ingestion pipelines (CSV/XML importers) built with the N-methods on a previous driver; ORM nationalized character-stream type handlers active after enabling ShardingSphere.","solutions":["Replace with ps.setCharacterStream(1, reader).","Disable nationalized character handling in your ORM (e.g. Hibernate hibernate.use_nationalized_character_data=false, remove @Nationalized).","Verify the backend database encoding is UTF-8/utf8mb4 so plain character streams carry the same data."],"exampleFix":"// before\nps.setNCharacterStream(1, reader);\n\n// after\nps.setCharacterStream(1, reader);","handlingStrategy":"fallback","validationCode":"ps.setCharacterStream(idx, reader); // instead of setNCharacterStream(idx, reader)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["No setN* method works on ShardingSphere PreparedStatement","Use setCharacterStream for all streamed text","Verify database character_set settings make N binds unnecessary"],"tags":["jdbc","shardingsphere","preparedstatement","nchar","streaming","sql-feature-not-supported"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}