diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultBindContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultBindContext.java index 578db158a1..470ee3f3e5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultBindContext.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultBindContext.java @@ -70,7 +70,10 @@ import org.jooq.exception.SQLDialectNotSupportedException; import org.jooq.tools.Convert; import org.jooq.tools.JooqLogger; import org.jooq.types.DayToSecond; -import org.jooq.types.UNumber; +import org.jooq.types.UByte; +import org.jooq.types.UInteger; +import org.jooq.types.ULong; +import org.jooq.types.UShort; import org.jooq.types.YearToMonth; /** @@ -252,8 +255,17 @@ class DefaultBindContext extends AbstractBindContext { stmt.setString(nextIndex(), value.toString()); } } - else if (UNumber.class.isAssignableFrom(type)) { - stmt.setString(nextIndex(), value.toString()); + else if (type == UByte.class) { + stmt.setShort(nextIndex(), ((UByte) value).shortValue()); + } + else if (type == UShort.class) { + stmt.setInt(nextIndex(), ((UShort) value).intValue()); + } + else if (type == UInteger.class) { + stmt.setLong(nextIndex(), ((UInteger) value).longValue()); + } + else if (type == ULong.class) { + stmt.setBigDecimal(nextIndex(), new BigDecimal(value.toString())); } else if (type == UUID.class) { switch (dialect) {