{"record":{"id":"5a6d83af98299682","repo":"apache/shardingsphere","slug":"getasciistream","errorCode":null,"errorMessage":"getAsciiStream","messagePattern":"getAsciiStream","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"warning","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java","lineNumber":41,"sourceCode":"import java.sql.Blob;\nimport java.sql.Clob;\nimport java.sql.Date;\nimport java.sql.SQLException;\nimport java.sql.SQLFeatureNotSupportedException;\nimport java.sql.SQLWarning;\nimport java.sql.SQLXML;\nimport java.sql.Time;\nimport java.sql.Timestamp;\nimport java.util.Calendar;\n\n/**\n * Unsupported Database meta data result set.\n */\npublic abstract class AbstractUnsupportedDatabaseMetaDataResultSet extends AbstractUnsupportedOperationResultSet {\n    \n    @Override\n    public final InputStream getAsciiStream(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getAsciiStream\");\n    }\n    \n    @Override\n    public final InputStream getAsciiStream(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getAsciiStream\");\n    }\n    \n    @Override\n    public final InputStream getUnicodeStream(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getUnicodeStream\");\n    }\n    \n    @Override\n    public final InputStream getUnicodeStream(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getUnicodeStream\");\n    }\n    \n    @Override","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedDatabaseMetaDataResultSet.java#L23-L59","documentation":"SQLFeatureNotSupportedException from AbstractUnsupportedDatabaseMetaDataResultSet.getAsciiStream(int): ShardingSphere's DatabaseMetaData result sets deliberately do not implement the deprecated/legacy stream accessors — getAsciiStream, getUnicodeStream, getUnicodeStream(String) — and throw with the method name as the message.","triggerScenarios":"Calling rs.getAsciiStream(columnIndex) or rs.getAsciiStream(columnLabel) (or getUnicodeStream variants) on any ResultSet returned by DatabaseMetaData methods of the ShardingSphere driver. Only the metadata result sets are affected; normal query result sets are not backed by this class.","commonSituations":"Old report/tooling code using deprecated JDBC 1 stream accessors; generic libraries probing every accessor on a result set; copy-pasted legacy data-export routines run against metadata results.","solutions":["Replace getAsciiStream with getString plus explicit encoding for metadata result sets.","If binary-safe reading is required, use getBytes/getObject instead.","Update legacy code: getAsciiStream on metadata was deprecated since JDBC 2."],"exampleFix":"// before\nInputStream in = metaRs.getAsciiStream(1);\n// after\nString value = metaRs.getString(1);\nInputStream in = new ByteArrayInputStream(value.getBytes(StandardCharsets.US_ASCII));","handlingStrategy":"fallback","validationCode":"// check capability via instanceof before legacy accessors\nif (rs instanceof AbstractUnsupportedDatabaseMetaDataResultSet) useGetStringInstead();","typeGuard":null,"tryCatchPattern":"try { rs.getAsciiStream(1); } catch (SQLFeatureNotSupportedException ex) { in = new ByteArrayInputStream(rs.getString(1).getBytes(US_ASCII)); }","preventionTips":["Avoid deprecated JDBC 1 stream accessors","Use getString/getBytes on metadata result sets","Update legacy export code to modern accessors"],"tags":["jdbc","metadata","deprecated-api","unsupported-feature"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}