Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6687187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:15:32+00:00 2026-05-26T05:15:32+00:00

Note: Answer at end of question I have created some columns in my My

  • 0

Note: Answer at end of question

I have created some columns in my My SQL database and have evidently not created floating point before because I had to look it up. For SQL compliance, I created my columns thus:

ALTER TABLE sensor
ADD Field1_Calibration_Offset DECIMAL(4, 3);

Times 8 for each column.

I have defined these in my java code such:

@Column(name = “FIELD1_CALIBRATION_OFFSET”)
private Float field1CalibrationOffset;

which generated the error:

Wrong column type in PsDb.dbo.Sensor for column FIELD1_CALIBRATION_OFFSET. Found: decimal, expected: float

Final Answer

Following @jbrookover’s answer below, I changed to BigDecimal, I got:

Wrong column type in PsDb.dbo.Sensor for column FIELD1_CALIBRATION_OFFSET. Found: decimal, expected: numeric(19,2)

So I looked up my hibernate mappings and did:

@Column(name = "FIELD1_CALIBRATION_SCALE", columnDefinition="decimal", precision=4, scale=3)
private BigDecimal field1CalibrationScale;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:15:33+00:00Added an answer on May 26, 2026 at 5:15 am

    I tend to let Hibernate create my tables, so I’m not 100% on this, but there is no reason to assume that Java’s Float maps to MySQL’s DECIMAL. In fact, according to the documentation, DECIMAL is an exact type while FLOAT and REAL are approximations. I believe Java’s Float is an approximation, so this mismatch seems logical.

    If you want to use MySQL’s DECIMAL, try Java’s java.math.BigDecimal instead of java.lang.Float.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: To answer this question, you shouldn't have to know anything about Selenium or
Note that I'm really looking for an answer to my question. I am not
Note: This is question to which I have already found an answer. It seems
PLEASE NOTE: I've answered my own question with a link to an answer to
[Note: There is another thread about this problem but it did not answer the
Scenario: You have a reasonably sized project with some forms, classes, etc. Question: How
NOTE: I am not exactly sure how to title or tag this question, so
EDIT The bare-bones version of this question is, if I have some object o
From android documentation: NOTE: Seeing Parcelable might have triggered the question, why is Android
I have a similar question as Ruby on Rails. Unicode routes but the answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.