{"record":{"id":"410c831afa52d72d","repo":"apache/shardingsphere","slug":"getparametermode","errorCode":null,"errorMessage":"getParameterMode","messagePattern":"getParameterMode","errorType":"exception","errorClass":"SQLFeatureNotSupportedException","httpStatus":null,"severity":"error","filePath":"jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationParameterMetaData.java","lineNumber":68,"sourceCode":"    \n    @Override\n    public final int getParameterType(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getParameterType\");\n    }\n    \n    @Override\n    public final String getParameterTypeName(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getParameterTypeName\");\n    }\n    \n    @Override\n    public final String getParameterClassName(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getParameterClassName\");\n    }\n    \n    @Override\n    public final int getParameterMode(final int parameter) throws SQLException {\n        throw new SQLFeatureNotSupportedException(\"getParameterMode\");\n    }\n}\n","sourceCodeStart":50,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/unsupported/AbstractUnsupportedOperationParameterMetaData.java#L50-L71","documentation":"SQLFeatureNotSupportedException thrown by AbstractUnsupportedOperationParameterMetaData.getParameterMode(int) (parameterModeIn/Out/InOut). ShardingSphere's parsed SQLStatement carries no IN/OUT mode information for JDBC-style '?' placeholders, and the driver does not support callable out-parameters this way, so the final method always throws.","triggerScenarios":"ps.getParameterMetaData().getParameterMode(i) on jdbc:shardingsphere:. Hit by stored-procedure wrappers and generic codegen tools that classify parameters before binding.","commonSituations":"Code generators (queryDSL-like mappers, CRUD UI builders) run against the sharded datasource; apps moved from a driver that returned parameterModeIn.","solutions":["Assume parameterModeIn for every '?' in a PreparedStatement; that is the only mode plain SQL binding has.","Use CallableStatement metadata on a plain datasource for actual stored procedures; ShardingSphere's inline JDBC path does not provide it.","Catch SQLFeatureNotSupportedException and continue with the default IN-mode behavior."],"exampleFix":"// before\nint mode = pmd.getParameterMode(1);\n\n// after\nint mode = ParameterMetaData.parameterModeIn; // '?' in a PreparedStatement is always IN","handlingStrategy":"validation","validationCode":"int mode = ParameterMetaData.parameterModeIn; // correct for every '?' in a PreparedStatement; skip getParameterMode entirely","typeGuard":null,"tryCatchPattern":"try { mode = pmd.getParameterMode(1); } catch (final SQLFeatureNotSupportedException e) { mode = ParameterMetaData.parameterModeIn; }","preventionTips":["Assume IN mode for PreparedStatement binds","Use CallableStatement on a plain datasource for OUT parameters","Do not build codegen that requires parameter modes from sharded connections"],"tags":["jdbc","shardingsphere","parametermetadata","sql-feature-not-supported"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}