File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes jsp and mysql error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jsp and mysql error" Watch "jsp and mysql error" New topic

jsp and mysql error

Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

how to insert a decimal value into mysql database.
eg: value like 2.5 to mysql field of datatype float.
but when i try to insert 2.5 from jsp to mysql database it get converted to 2 in the database??

[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

How is your float defined? How many digits do you allow after the decimal place?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46424
I think you will have to provide more detail. What format have you got the 2.5 in, and what sort of variable to you put it into, before inserting it into the database?
How did you specify the float value?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

Show us the code. I imagine there's somewhere your converting it to integer.

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: jsp and mysql error
jQuery in Action, 3rd edition