{"record":{"id":"f54bdc244778fa10","repo":"apache/shardingsphere","slug":"issigned","errorCode":null,"errorMessage":"isSigned","messagePattern":"isSigned","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationParameterMetaData.java","lineNumber":38,"sourceCode":"import org.apache.shardingsphere.driver.jdbc.adapter.WrapperAdapter;\n\nimport java.sql.ParameterMetaData;\nimport java.sql.SQLException;\nimport java.sql.SQLFeatureNotSupportedException;\n\n/**\n * Unsupported {@code ParameterMetaData} methods.\n */\npublic abstract class AbstractUnsupportedOperationParameterMetaData extends WrapperAdapter implements ParameterMetaData {\n    \n    @Override\n    public final int isNullable(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"isNullable\");\n    }\n    \n    @Override\n    public final boolean isSigned(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"isSigned\");\n    }\n    \n    @Override\n    public final int getPrecision(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getPrecision\");\n    }\n    \n    @Override\n    public final int getScale(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getScale\");\n    }\n    \n    @Override\n    public final int getParameterType(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getParameterType\");\n    }\n    \n    @Override","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationParameterMetaData.java#L20-L56","documentation":"SQLFeatureNotSupportedException thrown by AbstractUnsupportedOperationParameterMetaData.isSigned(int). ShardingSphere's ParameterMetaData is built purely from the locally parsed SQLStatement (ShardingSphereParameterMetaData only implements getParameterCount()); signedness of a '?' placeholder is not representable without backend type info, so the method is final and always throws.","triggerScenarios":"Calling ps.getParameterMetaData().isSigned(i) on a jdbc:shardingsphere: PreparedStatement. Typical offenders: schema-inspection utilities, JDBC 4 compliance test suites, and frameworks that pick numeric setters based on signedness.","commonSituations":"Generic ORM/repositories or reporting engines migrated onto sharding-jdbc; SQLServer/Oracle to ShardingSphere driver swaps where the old driver answered isSigned; automated DB-compat test suites failing only on sharded datasources.","solutions":["Remove the isSigned probe when running against ShardingSphere; bind values with setBigDecimal/setLong which ignore signedness.","If sign matters, read it from DatabaseMetaData.getColumns of the underlying database instead of ParameterMetaData.","Catch SQLFeatureNotSupportedException first and treat the parameter as signed-unknown (true is the safe default for numeric binding)."],"exampleFix":"// before\nboolean signed = pmd.isSigned(1);\n\n// after\nboolean signed = true; // assume signed; ShardingSphere ParameterMetaData cannot report it","handlingStrategy":"try-catch","validationCode":"if (!conn.getMetaData().getDriverName().toLowerCase().contains(\"shardingsphere\")) { boolean s = pmd.isSigned(1); }","typeGuard":"static boolean reportsParameterSign(final ParameterMetaData pmd) {\n    try { pmd.isSigned(1); return true; } catch (final SQLFeatureNotSupportedException e) { return false; }\n}","tryCatchPattern":"try {\n    signed = pmd.isSigned(1);\n} catch (final SQLFeatureNotSupportedException e) {\n    signed = true; // safe default for numeric binding\n}","preventionTips":["Do not branch binding logic on parameter signedness","Bind with setBigDecimal/setLong which are sign-agnostic","Keep a metadata-probe feature check per driver"],"tags":["jdbc","shardingsphere","parametermetadata","sql-feature-not-supported"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}