Subject | Re: TypeConvertionException |
---|---|
Author | rrokytskyy |
Post date | 2002-04-02T15:52:34Z |
> org.firebirdsql.jdbc.TypeConvertionException: Error converting tofloat.
> at org.firebirdsql.jdbc.FBDoubleField.getFloat(FBDoubleField.java:99)
> at org.firebirdsql.jdbc.FBResultSet.getFloat(FBResultSet.java:257)Usually it works like you expect... Here's the code that throws an
> at org.firebirdsql.jdbc.FBResultSet.getFloat(FBResultSet.java:390)
>
>
> Is this a bug or a feature ?
> I think getFloat on a double field should do a normal convertion
> like:
> double d;
> float f = (float)d;
exception:
// check if value is withing bounds
if (value.doubleValue() > Float.MAX_VALUE ||
value.doubleValue() < Float.MIN_VALUE)
throw (SQLException)createException(
FLOAT_CONVERSION_ERROR).fillInStackTrace();
So, I would check if the value you supply to the JDBC driver can be
downcasted to float.
Best regards,
Roman Rokytskyy