1) add code to handle value mismatch

 for example, the database return Long, but we know the number is small and we need Integer;

 also add handle for BigDecimal

2) Add the following logic for numbers:

 If sql type is Decimal or Numeric, the scale == 0, and precision < 9  return Int

 If sql type is Decimal or Numeric, the scale == 0, and precision <= 18 and precision > 9  return Long

 If sql type is Decimal or Numeric, the scale == 0, and precision > 18   return BigDecimal

  If sql type is Decimal or Numeric, the scale > 0, and precision <= 9 return Double

  If sql type is Decimal or Numeric, the scale > 0, and precision > 9 return BigDecimal
1) add code to handle value mismatch

 for example, the database return Long, but we know the number is small and we need Integer;

 also add handle for BigDecimal

2) Add the following logic for numbers:

 If sql type is Decimal or Numeric, the scale == 0, and precision < 9  return Int

 If sql type is Decimal or Numeric, the scale == 0, and precision <= 18 and precision > 9  return Long

 If sql type is Decimal or Numeric, the scale == 0, and precision > 18   return BigDecimal

  If sql type is Decimal or Numeric, the scale > 0, and precision <= 9 return Double

  If sql type is Decimal or Numeric, the scale > 0, and precision > 9 return BigDecimal