{"record":{"id":"b0fecb912a77cde8","repo":"apache/shardingsphere","slug":"getclob-b0fecb","errorCode":null,"errorMessage":"getClob","messagePattern":"getClob","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java","lineNumber":202,"sourceCode":"    \n    @Override\n    public final int getFetchSize() throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getFetchSize\");\n    }\n    \n    @Override\n    public final Blob getBlob(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getBlob\");\n    }\n    \n    @Override\n    public final Blob getBlob(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getBlob\");\n    }\n    \n    @Override\n    public final Clob getClob(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getClob\");\n    }\n    \n    @Override\n    public final Clob getClob(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getClob\");\n    }\n    \n    @Override\n    public final URL getURL(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n    \n    @Override\n    public final URL getURL(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getURL\");\n    }\n    \n    @Override","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java#L184-L220","documentation":"getClob(int columnIndex) always throws SQLFeatureNotSupportedException(\"getClob\") in AbstractUnsupportedGeneratedKeysResultSet:202, the parent of ShardingSphere's GeneratedKeysResultSet. Generated keys are held as an in-memory iterator of numeric values, so there is no CLOB to return and the accessor is explicitly unsupported rather than returning null.","triggerScenarios":"Calling resultSet.getClob(1) on the keys ResultSet from getGeneratedKeys() — often from generic mappers whose metadata inspection of the key column steers them into CLOB handling, or from code that reads all columns as LOBs first.","commonSituations":"Legacy CLOB-based text handling applied to every result set; data-export pipelines; apps previously on native drivers where getClob on generated keys threw a friendlier error or returned null — after adopting ShardingSphere-JDBC the SQLFeatureNotSupportedException surfaces at the same call site.","solutions":["Use keys.getString(1)/keys.getLong(1) instead.","Gate CLOB handling to SELECT result sets; never run it on generated-keys output.","If character payload is needed, SELECT it afterward using the generated key.","In adapters, catch SQLFeatureNotSupportedException and retry with getString(1)."],"exampleFix":"// before\nClob c = keys.getClob(1);\n\n// after\nString id = keys.getString(1);","handlingStrategy":"try-catch","validationCode":"int type = keys.getMetaData().getColumnType(1);\nif (type != Types.CLOB) { String id = keys.getString(1); }","typeGuard":"private static boolean isGeneratedKeysRs(ResultSet rs) {\n    return rs.getClass().getName().endsWith(\"GeneratedKeysResultSet\");\n}","tryCatchPattern":"try {\n    Clob c = rs.getClob(1);\n} catch (SQLFeatureNotSupportedException e) {\n    String v = rs.getString(1);\n}","preventionTips":["Scope CLOB type handlers to text columns of query result sets.","Read generated keys with getString/getLong.","Don't reuse generic row-serialization code on key result sets."],"tags":["jdbc","shardingsphere","generated-keys","clob","lob","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}