jdbcmybatisibatisspring-mybatis

jdbcType=BIGDECIMAL not supported in mybatis and ibatis


Using jdbcType=BIGDECIMAL is not supported in myBatis and ibatis and is throwing the next error:

Error resolving JdbcType. Cause: java.lang.IllegalArgumentException: 
No enum constant org.apache.ibatis.type.JdbcType.BIGDECIMAL

What is the jdbcType alternative instead of BIGDECIMAL?

I'm using mybatis-3.4.4 version


Solution

  • That's happen because BIGDECIMAL jdbc type doesn't exist. Just take a look the enum JdbcType of org.apache.ibatis.type.

    You should use DECIMAL.


    The list of JdbcTypes available in JdbcType enum:

    ARRAY(2003),
    BIT(-7),
    TINYINT(-6),
    SMALLINT(5),
    INTEGER(4),
    BIGINT(-5),
    FLOAT(6),
    REAL(7),
    DOUBLE(8),
    NUMERIC(2),
    DECIMAL(3),
    CHAR(1),
    VARCHAR(12),
    LONGVARCHAR(-1),
    DATE(91),
    TIME(92),
    TIMESTAMP(93),
    BINARY(-2),
    VARBINARY(-3),
    LONGVARBINARY(-4),
    NULL(0),
    OTHER(1111),
    BLOB(2004),
    CLOB(2005),
    BOOLEAN(16),
    CURSOR(-10),
    UNDEFINED(-2147482648),
    NVARCHAR(-9),
    NCHAR(-15),
    NCLOB(2011),
    STRUCT(2002),
    JAVA_OBJECT(2000),
    DISTINCT(2001),
    REF(2006),
    DATALINK(70),
    ROWID(-8),
    LONGNVARCHAR(-16),
    SQLXML(2009),
    DATETIMEOFFSET(-155);