{"record":{"id":"6483578535062cfd","repo":"mybatis/mybatis-3","slug":"error-resolving-jdbctype-cause-cause","errorCode":null,"errorMessage":"Error resolving JdbcType. Cause: {cause}","messagePattern":"Error resolving JdbcType\\. Cause: (.+?)","errorType":"exception","errorClass":"BuilderException","httpStatus":null,"severity":"error","filePath":"src/main/java/org/apache/ibatis/builder/BaseBuilder.java","lineNumber":71,"sourceCode":"\n  protected Boolean booleanValueOf(String value, Boolean defaultValue) {\n    return value == null ? defaultValue : Boolean.valueOf(value);\n  }\n\n  protected Integer integerValueOf(String value, Integer defaultValue) {\n    return value == null ? defaultValue : Integer.valueOf(value);\n  }\n\n  protected Set<String> stringSetValueOf(String value, String defaultValue) {\n    value = value == null ? defaultValue : value;\n    return new HashSet<>(Arrays.asList(value.split(\",\")));\n  }\n\n  protected JdbcType resolveJdbcType(String alias) {\n    try {\n      return alias == null ? null : JdbcType.valueOf(alias);\n    } catch (IllegalArgumentException e) {\n      throw new BuilderException(\"Error resolving JdbcType. Cause: \" + e, e);\n    }\n  }\n\n  protected ResultSetType resolveResultSetType(String alias) {\n    try {\n      return alias == null ? null : ResultSetType.valueOf(alias);\n    } catch (IllegalArgumentException e) {\n      throw new BuilderException(\"Error resolving ResultSetType. Cause: \" + e, e);\n    }\n  }\n\n  protected ParameterMode resolveParameterMode(String alias) {\n    try {\n      return alias == null ? null : ParameterMode.valueOf(alias);\n    } catch (IllegalArgumentException e) {\n      throw new BuilderException(\"Error resolving ParameterMode. Cause: \" + e, e);\n    }\n  }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/mybatis/mybatis-3/blob/008069adb1b089579b5dcba87ee591908b263274/src/main/java/org/apache/ibatis/builder/BaseBuilder.java#L53-L89","documentation":"BaseBuilder.resolveJdbcType() converts a configuration string (e.g. jdbcType attributes on #{...} placeholders, parameter/result mappings) into the JdbcType enum via valueOf(). Any string that is not an exact enum constant name throws IllegalArgumentException, wrapped into this BuilderException during parse time.","triggerScenarios":"jdbcType=\"VARCHAR2\" (not a JdbcType constant; the correct value is VARCHAR); jdbcType=\"varchar\" lowercase (valueOf is case-sensitive); typos like jdbcType=\"NUMERIC \" with trailing whitespace; a custom jdbcType invented in XML.","commonSituations":"Hand-writing XML parameter maps; copying Oracle/DB2 native type names into jdbcType attributes; tool-generated mappings using vendor type names.","solutions":["Use an exact JdbcType enum constant (VARCHAR, INTEGER, TIMESTAMP, OTHER, ...) matching the case","For vendor-specific types, map to the closest standard JdbcType or use jdbcType=OTHER with a custom TypeHandler"],"exampleFix":"<!-- before -->\n#{id,jdbcType=VARCHAR2}\n<!-- after -->\n#{id,jdbcType=VARCHAR}","handlingStrategy":"validation","validationCode":"static final Set<String> VALID = Arrays.stream(JdbcType.values()).map(Enum::name).collect(Collectors.toSet());\nvoid check(String jdbcType) { if (!VALID.contains(jdbcType)) throw new IllegalArgumentException(jdbcType); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use standard JdbcType constant names, exact upper case","Add a unit test that parses every mapper XML at build time so typos fail CI, not production"],"tags":["mybatis","builder","jdbc-type","configuration"],"backgroundTag":null,"analyzedSha":"008069adb1b089579b5dcba87ee591908b263274","analyzedAt":"2026-08-14T13:07:10.264Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}