|Subject||Re: [Firebird-Java] org.firebirdsql.jdbc.field.TypeConvertionException: Error converting to long.|
> When debugging, the rsmd.getColumnType(i) of the num15_0 fieldI would say that you get the VARCHAR there. Two reasons:
> resolves to 12, which is the constant for java.sql.Types.VARCHAR. So
> the default case of the switch-statement is called and the following
> error occurs:
> org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
> to long.
> Is there a bug in firebird/jaybird or am I doing something wrong?
a) I checked the sources, and I am pretty sure that for NUMERIC(15,0)
Jaybird would return Types.NUMERIC
b) Even if not, it would then convert the number into a String in
rs.getString() method and the ps.setString(...) would parse the number,
convert it into Long and send back to the server. Since we have no
decimal point, it will be 100% parsable. But you get an error there.
Therefore, please check the contents of the field.
If it does not work, please prepare a reproducable test case, I will