This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3697
    
    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: 1476
    
  11

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.
 
Similar Threads
using init-param to set a value in a table
Generating & Recognizing keys in java
Mapping to an xml typed column (PostgreSQL) on an EJB3 entity in JBoss 5.1
Problem with รจ character in Java.
String, read and write file problem...