{"record":{"id":"e8232b15a4353f9d","repo":"flowable/flowable-engine","slug":"error-setting-non-null-for-parameter-i-with-jd","errorCode":null,"errorMessage":"Error setting non null for parameter #${i} with JdbcType ${jdbcType} . Try setting a different JdbcType for this parameter or a different configuration property. Cause: ${e}","messagePattern":"Error setting non null for parameter #(.+?) with JdbcType (.+?) \\. Try setting a different JdbcType for this parameter or a different configuration property\\. Cause: (.+?)","errorType":"exception","errorClass":"TypeException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/FlowableStringTypeHandler.java","lineNumber":49,"sourceCode":"                        finalJdbcType = JdbcType.VARCHAR;\n                    } else {\n                        finalJdbcType = jdbcType;\n                    }\n                    ps.setNull(i,  finalJdbcType.TYPE_CODE);\n                    \n                } else {\n                    ps.setNull(i, Types.NULL);\n                }\n            } catch (SQLException e) {\n                throw new TypeException(\"Error setting null for parameter #\" + i + \" with JdbcType \" + jdbcType + \" . \"\n                      + \"Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. \"\n                      + \"Cause: \" + e, e);\n            }\n        } else {\n            try {\n                setNonNullParameter(ps, i, parameter, jdbcType);\n            } catch (Exception e) {\n              throw new TypeException(\"Error setting non null for parameter #\" + i + \" with JdbcType \" + jdbcType + \" . \"\n                  + \"Try setting a different JdbcType for this parameter or a different configuration property. \" + \"Cause: \"\n                  + e, e);\n            }\n        }\n    }\n\n    @Override\n    public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException {\n        ps.setString(i, parameter);\n    }\n\n    @Override\n    public String getNullableResult(ResultSet rs, String columnName) throws SQLException {\n        return rs.getString(columnName);\n    }\n\n    @Override\n    public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/FlowableStringTypeHandler.java#L31-L67","documentation":"TypeException raised when setting a NON-null String parameter fails in FlowableStringTypeHandler.setParameter: setNonNullParameter threw, and the handler wraps the failure with the parameter index and JdbcType plus a hint to adjust the mapping or configuration. The original exception is the cause.","triggerScenarios":"Binding an actual (non-null) value where the driver rejects it: value longer than the column (VARCHAR size / ORA-12899), invalid characters or encoding, wrong JdbcType for the column, or the target column is NOT NULL but... value conversion issues in custom SQL.","commonSituations":"Storing a string longer than the column definition; charset/collation mismatches (e.g. 4-byte UTF-8 into utf8 column); custom mappings with mismatched jdbcType; driver incompatibilities after a DB upgrade.","solutions":["Read the cause: length/encoding errors mean enlarging the column or truncating the value.","Match the jdbcType in the mapping to the actual column type.","Enable larger types (CLOB/NVARCHAR) or adjust NLS/charset configuration for the driver.","Update or align the JDBC driver with the database server version."],"exampleFix":"// before\n#{longText,jdbcType=VARCHAR}\n// after\n#{longText,jdbcType=CLOB} // or ALTER TABLE ... MODIFY longText VARCHAR(4000)","handlingStrategy":"try-catch","validationCode":"if (value != null && value.length() > columnMaxLength) throw new IllegalArgumentException(\"value exceeds column length\");","typeGuard":null,"tryCatchPattern":"catch (TypeException e) { if (e.getMessage().startsWith(\"Error setting non null\")) { log.error(\"bind failed\", e.getCause()); /* check length/encoding/jdbcType */ } throw e; }","preventionTips":["Size columns for worst-case values or use CLOB.","Match mapping jdbcType to the actual column type.","Keep JDBC driver and DB server versions aligned.","Watch charset/collation (utf8mb4 for 4-byte chars)."],"tags":["mybatis","jdbc","database","binding","flowable"],"backgroundTag":"sql-query-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}