Subject | Re: [Firebird-Java] Setting Long.MAX_VALUE as value for long parameter resilts in error |
---|---|

Author | Roman Rokytskyy |

Post date | 2006-08-11T11:46:59Z |

> I have an EJBQL select where I use Long.MAX_VALUE as parameter and IAnd your question is? :)

> get error in FBBigDecimalField.java on line 255.

The reason for this is that your field is defined as NUMERIC(18,n) where n >

0. This reduces the maximum possible value, since the fixed-point numbers

are stored in the scaled format and the decimal places must be specified

too. In case of Long.MAX_VALUE, which is already 19 digits long, you require

Firebird to add n zero digits according to the column definition - that

simply is greater than maximum possible numeric value that can be sent to

Firebird over the wire. The only fix to this situation is to use the BIGINT

column (or don't use Long.MAX_VALUE, take something smaller).

Roman