It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes Data type mismatch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Data type mismatch" Watch "Data type mismatch" New topic

Data type mismatch

Fred Victa
Ranch Hand

Joined: May 01, 2008
Posts: 151
I have the variable, MAX_ACV, which is of type double. In my program, it is equal to 1000000.00

I also have another variable, ACV, which is of type double.

In my program if the ACV is greater than the MAX_ACV, then there will be an error message that says that the ACV is too large.

My program reads an XML file and puts the data into a database. If the ACV in the XML file is a large number such as 999999.00, then I get an error message that says, "java.sql.SQLException: Data type mismatch. (javaValue (999999.00): Length is not valid)

Could anyone explain what that error means and how I can correct my program?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32649

What is the data type you are using in the database?

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Data type mismatch
jQuery in Action, 3rd edition