{"record":{"id":"cf1d1c858d92ee07","repo":"apache/shardingsphere","slug":"geturl","errorCode":null,"errorMessage":"getURL","messagePattern":"getURL","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java","lineNumber":212,"sourceCode":"    \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\n    public final SQLXML getSQLXML(final int columnIndex) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getSQLXML\");\n    }\n    \n    @Override\n    public final SQLXML getSQLXML(final String columnLabel) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getSQLXML\");\n    }\n}\n","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedGeneratedKeysResultSet.java#L194-L230","documentation":"getURL(int columnIndex) throws SQLFeatureNotSupportedException(\"getURL\") unconditionally at AbstractUnsupportedGeneratedKeysResultSet:212, so it fails on ShardingSphere's GeneratedKeysResultSet. The method (JDBC 3.0, largely DATALINK-specific and unsupported even by many native drivers) has no implementation for the synthesized numeric key column.","triggerScenarios":"Calling resultSet.getURL(1) on the keys ResultSet — usually a generic accessor-matrix walker that tries every typed getter, or column-statistics code that probes capabilities by calling all accessors.","commonSituations":"Reflection-based ORM mappers enumerating all getX methods; capability-probing test suites; code ported from apps where getURL was used casually on MySQL (where it throws SQLFeatureNotSupportedException too, but sometimes surfaced differently); failure noticed after moving to ShardingSphere-JDBC.","solutions":["Use getObject(1)/getLong(1) and construct any URL in application code.","Remove getURL probes from generic accessor walkers — the JDBC Datalink type is almost never what generated keys carry.","Catch SQLFeatureNotSupportedException in probe code and record the accessor as unsupported.","Ensure tests distinguish 'unsupported accessor' from 'broken statement' — this exception is expected here."],"exampleFix":"// before\nURL u = keys.getURL(1);\n\n// after\nObject key = keys.getObject(1);\n// build URL in app code if actually needed","handlingStrategy":"try-catch","validationCode":"Object v = keys.getObject(1); // DATALINK never applies to generated keys","typeGuard":"private static boolean isGeneratedKeysRs(ResultSet rs) {\n    return rs.getClass().getName().endsWith(\"GeneratedKeysResultSet\");\n}","tryCatchPattern":"try {\n    URL u = rs.getURL(1);\n} catch (SQLFeatureNotSupportedException e) {\n    Object key = rs.getObject(1);\n}","preventionTips":["Remove getURL from accessor-matrix walkers; DATALINK is rarely supported anywhere.","Build URLs in application code from scalar values.","Treat SQLFeatureNotSupportedException in probes as expected metadata."],"tags":["jdbc","shardingsphere","generated-keys","url","unsupported-operation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}