EMAIL REMOVED wrote:
> Hello,
>
> Hoping to get some help on something that just makes no sense to me...
> Here's hoping someone can help!
>
> I have table setup with a data type as such:
> max_dollars double(4,2)
>
> I have a piece of Java code that takes a form entry and submits it to
> the database. The insert command looks like this:
> db_insert = "insert into BIG_MONEY (max_dollars) values
> ("+request.getParameter("maxdollars"))";
> stmt.executeUpdate(db_insert);
>
> The problem is that when I type in: 140 in the textbox, MySQL throws an
> error that looks like this:
> SQLException Data truncation: Out of range value adjusted for column
> 'max_dollars' at row 1
>
> What gives??? I did some looking on the groups and found something that
> said to try adding the following to the URL:
> ?jdbcCompliantTruncation=false
>
> That eliminated the error, but now it just rounds off any number
> greater than 100 to 99.99... Any ideas??? This is driving me mad...
>
> Let me know if I left anything else out that might help... Oh, I'm
> using MySQL version 5.0.27 and MySQL Java connector 5.04
>
> Thank in advance...
> Nino Skilj
>
Well, you defined the field to take a maximum of 99.99. What do you
expect MySQL to do?
If you want to put 140 in there, you need to leave room for three digits
to the left of the decimal point.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
EMAIL REMOVED
==================