Subject | TypeConvertionException |
---|---|
Author | Carsten Schäfer |
Post date | 2002-04-02T15:43:13Z |
Hi,
first of all thanks to Daniel who supplied me with all the relevant jars so i can test the driver.
First Test, first problem.
(Win2000SP2,JDK1.3.1_03,Firebird1.0)
In database definition i always uses the type double precision for my decimals.
In my application i parsed them with getFloat where i needed just a float and with getDouble where i needed a double.
This was no problem with Interclient.
With firebirdsql i get a TypeConvertionException when i call getFloat on a double precision field.
org.firebirdsql.jdbc.TypeConvertionException: Error converting to float.
at org.firebirdsql.jdbc.FBDoubleField.getFloat(FBDoubleField.java:99)
at org.firebirdsql.jdbc.FBResultSet.getFloat(FBResultSet.java:257)
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;
gruse
Carsten
first of all thanks to Daniel who supplied me with all the relevant jars so i can test the driver.
First Test, first problem.
(Win2000SP2,JDK1.3.1_03,Firebird1.0)
In database definition i always uses the type double precision for my decimals.
In my application i parsed them with getFloat where i needed just a float and with getDouble where i needed a double.
This was no problem with Interclient.
With firebirdsql i get a TypeConvertionException when i call getFloat on a double precision field.
org.firebirdsql.jdbc.TypeConvertionException: Error converting to float.
at org.firebirdsql.jdbc.FBDoubleField.getFloat(FBDoubleField.java:99)
at org.firebirdsql.jdbc.FBResultSet.getFloat(FBResultSet.java:257)
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;
gruse
Carsten