integer and BigInt

246 views
Skip to first unread message

Patrice

unread,
May 21, 2012, 10:37:05 AM5/21/12
to h2-da...@googlegroups.com
Hi,

I need a column with an integer unsigned on 4 bytes but in H2 this is signed. So when I want to put the value 4278190080 (FF000000H) I have this message : Numeric value out of range: "4278190080".
How to put this value ? I prefer don't use BigInt.

Thank you.

patrice henrio

unread,
May 21, 2012, 10:48:23 AM5/21/12
to h2-da...@googlegroups.com
I find the way : the value is X'FF000000'

2012/5/21 Patrice <patrice.h...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To view this discussion on the web visit https://groups.google.com/d/msg/h2-database/-/X6-fQIHI_r4J.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.



--
Si vous vous intéressez à l'histoire, vous pouvez parcourir mon site : http://histoiremondiale.free.fr

Thomas Mueller

unread,
May 22, 2012, 3:04:09 PM5/22/12
to h2-da...@googlegroups.com
Hi,

Why not use BIGINT? It's a java.lang.Long, as required by the JDBC
Spec (not BigInteger). See also

http://h2database.com/html/datatypes.html#bigint_type
http://docs.oracle.com/javase/1.4.2/docs/guide/jdbc/getstart/mapping.html

Regards,
Thomas

Patrice

unread,
May 22, 2012, 4:47:34 PM5/22/12
to h2-da...@googlegroups.com
I solve my problem with the Hex value. I want only an integer in 4 bytes (it's a Color).
Thanks for your answer, I had tested this methode but I prefer this way.
Why "unsigned" is not supported with H2 ?


Le mardi 22 mai 2012 21:04:09 UTC+2, Thomas Mueller a écrit :
Hi,

Why not use BIGINT? It's a java.lang.Long, as required by the JDBC
Spec (not BigInteger). See also

http://h2database.com/html/datatypes.html#bigint_type
http://docs.oracle.com/javase/1.4.2/docs/guide/jdbc/getstart/mapping.html

Regards,
Thomas


On Mon, May 21, 2012 at 4:37 PM, Patrice <patrice.h...@gmail.com> wrote:
> Hi,
>
> I need a column with an integer unsigned on 4 bytes but in H2 this is
> signed. So when I want to put the value 4278190080 (FF000000H) I have this
> message : Numeric value out of range: "4278190080".
> How to put this value ? I prefer don't use BigInt.
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/h2-database/-/X6-fQIHI_r4J.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to

Thomas Mueller

unread,
May 23, 2012, 3:32:47 PM5/23/12
to h2-da...@googlegroups.com
Hi

> Why "unsigned" is not supported with H2 ?

Because it's non-standard. What SQL type (java.sql.Types) and Java
type would it be?

Please note in a database file, for H2, BIGINT (java.lang.Long) and
INT (java.lang.Integer) typically need the same space.

Regards,
Thomas

patrice henrio

unread,
May 23, 2012, 4:59:14 PM5/23/12
to h2-da...@googlegroups.com
OK. I don't know this (the non standard unsigned and the place of a BigInt and an Integer)

Thanks.

2012/5/23 Thomas Mueller <thomas.to...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.

Reply all
Reply to author
Forward
0 new messages