aspose file tools*
The moose likes JDBC and the fly likes The conversion of the varchar value '5438954444' overflowed an int column. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "The conversion of the varchar value Watch "The conversion of the varchar value New topic
Author

The conversion of the varchar value '5438954444' overflowed an int column.

veda Cherak
Greenhorn

Joined: Aug 16, 2011
Posts: 13
Hi,
I am getting the above exception. Please help.
I populated my column(Sys_number) with 10 rows and each with 10 digits.
When I enter any value less than 10 digits I get this exception.

Name : Sys_Number
Datatype : varchar(50)

Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Can you post the exception? Also, it's better to used PreparedStatements for input parameter than Statements.


My Blog: Down Home Country Coding with Scott Selikoff
chris webster
Bartender

Joined: Mar 01, 2009
Posts: 1873
    
  16

The error message seems plausible, because 5,438,954,444 would be too big a value for an int variable. As I understand it, an int can hold values between -2,147,483,648 and 2,147,483,647. So the question is what is really in your table - is this big value really in there, or is it created accidentally in your Java code? If the value is correct, then maybe you need to use a long variable in Java instead.

Why don't you run your SQL separately in your database's SQL interface, so you can check what's really in your table? Then you'll know whether the problem is data or code.


No more Blub for me, thank you, Vicar.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The conversion of the varchar value '5438954444' overflowed an int column.