Subject Re: [Firebird-Java] Error converting to Long
Author David Jencks
This is kind of a guess...

What is the actual sql type of the database column? It it's an integer
less than 18 digits I'd guess the problem is in jboss's mapping code.
If it's really NUMERIC(18,0) it looks like jaybird has erroneously used
an FBIntegerField.

thanks
david jencks

On Feb 2, 2005, at 5:17 AM, jivkoto wrote:

>
>
> Hi to all of you,
> I'm using Firebird 1.5.2 with Jaybird 1.5.5 and jboss 3.2.6.
> I have this strange problem. I have ejb with CMP 2.x it has finder
> method that I am trying to use. It has two input parameters String and
> long. The problem is that when this finder method is called exception
> is thrown saying for problem converting to long. Here is snippet of
> the exception that bothers me:
>
> org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
> to long. 1107349695875
>         at
> org.firebirdsql.jdbc.field.FBIntegerField.setLong(FBIntegerField.java
> :157)
>         at org.firebirdsql.jdbc.field.FBField.setO
> bject(FBField.java:727)
>         at
> org.firebirdsql.jdbc.AbstractPreparedStatement.setObject(AbstractPrep
> aredStatement.java:218)
>
> As you see it seems to be some problem with setLong method.
>
> Here is snippet of my conf\standardjbosscmp-jdbc.xml configuration
> file that maps Long to jdbc type BIGINT ant to Firebird specific
> NUMERIC(18,0)
>
>          <mapping>
>             <java-type>java.lang.Long</java-type>
>             <jdbc-type>BIGINT</jdbc-type>
>             <sql-type>NUMERIC(18,0) default 0</sql-type>
>          </mapping>
>
> I am wondering is it some jboss mapping problem or jaybird driver
> problem?
>
>
> If anyone could help I will be thankful.
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
> • To visit your group on the web, go to:
> http://groups.yahoo.com/group/Firebird-Java/
>  
> • To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>  
> • Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>