aspose file tools
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


JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jsp and mysql error" Watch "jsp and mysql error" New topic
Author

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.!!!
SCJP1.5.
Paul Sturrock
Bartender

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
Sheriff

Joined: Oct 13, 2005
Posts: 41868
    
  31
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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3740
    
  10

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


[OCA 8 Book] [Blog]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp and mysql error