You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by David <da...@gmail.com> on 2009/01/16 07:58:40 UTC

unsigned bigint

Anyone run into mapping an unsigned BIGINT? I don't see how its possible
in Java?

--
dlm


Re: unsigned bigint

Posted by David McReynolds <da...@gmail.com>.
Judging from the exception the driver is throwing, I don't think either is
possible. Remember, Java doesn't do unsigned. All the JDBC driver seems to
know is that its a BIGINT. It has no concept of UNSIGNED BIGINT.

On Fri, Jan 16, 2009 at 1:27 PM, Jeff Butler <je...@gmail.com> wrote:

> Assuming you are using MySQL...
>
> Connector/J documentation states that you should use
> ResultSet.getObject(), and then cast to java.math.BigInteger.
>
> So in iBATIS, you should set your bean property type to Object, and
> then cast it to BigInteger after the result is returned from iBATIS.
> Or, you could create a type handler that would do this within the
> iBATIS processing.
>
> Jeff Butler
>
>
> On Fri, Jan 16, 2009 at 2:52 AM, Ingmar Lötzsch
> <il...@asci-systemhaus.de> wrote:
> >> Anyone run into mapping an unsigned BIGINT? I don't see how its possible
> >> in Java?
> >
> > Why can't you use Long or long?
> >
>



-- 
--
dlm

Re: unsigned bigint

Posted by Jeff Butler <je...@gmail.com>.
Assuming you are using MySQL...

Connector/J documentation states that you should use
ResultSet.getObject(), and then cast to java.math.BigInteger.

So in iBATIS, you should set your bean property type to Object, and
then cast it to BigInteger after the result is returned from iBATIS.
Or, you could create a type handler that would do this within the
iBATIS processing.

Jeff Butler


On Fri, Jan 16, 2009 at 2:52 AM, Ingmar Lötzsch
<il...@asci-systemhaus.de> wrote:
>> Anyone run into mapping an unsigned BIGINT? I don't see how its possible
>> in Java?
>
> Why can't you use Long or long?
>

Re: unsigned bigint

Posted by Ingmar Lötzsch <il...@asci-systemhaus.de>.
> Anyone run into mapping an unsigned BIGINT? I don't see how its possible
> in Java?

Why can't you use Long or long?