This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "equivalent of bigInt in java" Watch "equivalent of bigInt in java" New topic

equivalent of bigInt in java

Mala Sharma
Ranch Hand

Joined: Oct 29, 2004
Posts: 76
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.

marc weber

Joined: Aug 31, 2004
Posts: 11343

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

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
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().

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

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.
I agree. Here's the link:
subject: equivalent of bigInt in java
It's not a secret anymore!