Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp and mysql error

 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is your float defined? How many digits do you allow after the decimal place?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4010
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show us the code. I imagine there's somewhere your converting it to integer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic