aspose file tools*
The moose likes JDBC and the fly likes equivalent of bigInt in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "equivalent of bigInt in java" Watch "equivalent of bigInt in java" New topic
Author

equivalent of bigInt in java

Mala Sharma
Ranch Hand

Joined: Oct 29, 2004
Posts: 76
Hello,
I'm a beginner in java. I'm trying to get results back from a table that has int and bigint value. i know how to get int value.

How do i get the bigInt back.? Thanks.

Mala
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

I believe the object type you're looking for is "BigInteger."

http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigInteger.html

So you would have something like:

BigInteger bigI;
bigI = ...; //might require a cast

(Or am I misunderstanding your question?)

EDIT: I see I misunderstood. I didn't realize that rs was a ResultSet.
[ November 01, 2004: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Joyce Lee
Ranch Hand

Joined: Jul 11, 2003
Posts: 1392
Hi Mala,

To retrieve bigint, it's recommended by the Sun Java Tutorial: JDBC to use getLong().



Joyce
[ October 29, 2004: Message edited by: Joyce Lee ]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the JDBC forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Joyce Lee:

To retrieve bigint, it's recommended by the Sun Java Tutorial: JDBC to use getLong().


cent percent Agreement. there is no better substitute.
thanks.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: equivalent of bigInt in java