Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

equivalent of bigInt in java

 
Mala Sharma
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Joyce Lee
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JDBC forum...
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic