| Author |
Mapping BigInteger java object into a ResultSet Data Type
|
Vikki Fiawoo
Greenhorn
Joined: Oct 22, 2010
Posts: 11
|
|
I have a simple question that has been driving me crazy for a few hours. I have researched all of over the web and cannot still seem to figure it out.
I have variable that I have set to a BigInteger. For example,
The this value is stored in the database as a tinyint.
I want to retrieve the data from the database using a resultset. I have tried several different datatypes and none of them are working. I am keep getting an error when I try to build my code. Here are some examples that I have tried to use:
I was also thinking that I need to explicitly convert the result set into a BigInteger.
Can someone please help with the mapping of my java BigInteger datatype and the correct sql datatype to use in my resultset. An example of this mapping would be extremely helpful
|
 |
joy b chakravarty
Ranch Hand
Joined: May 16, 2011
Posts: 62
|
|
|
try user.setUserId(new BigInteger(Integer.valueOf(rs.getInt("User_Id")).toString()));
|
Cheers, Joy [SCJP 1.4, SCBCD 5.0]
get high on alcohol, algorithm or both
|
 |
 |
|
|
subject: Mapping BigInteger java object into a ResultSet Data Type
|
|
|