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

  • SEARCH
  • Home
  • 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 8413941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:02:18+00:00 2026-06-10T01:02:18+00:00

I am inserting a row using ibatis and a java webapp. The POJO has

  • 0

I am inserting a row using ibatis and a java webapp. The POJO has a field which needs to store a number (like 3.0 or 2.34). I have tried using BigDecimal and Double on the java side. On the MySQL side, I am using a Decimal(5, 5) data type.

When I try to insert a row which has “4” as the value for this numeric field, MySQL and iBatis throw the following exception:

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation: encountered SQLException [  
--- The error occurred in org/mySQL.xml.  
--- The error occurred while applying a result map.  
--- Check the mySQL.insertQuery.  
--- The error happened while setting a property on the result object.  
--- Cause: java.lang.RuntimeException: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation: encountered SQLException [  
--- The error occurred while applying a parameter map.  
--- Check the insertQuery-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'numericColumn' at row 316]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
    at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithRowHandler(GeneralStatement.java:133)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryWithRowHandler(SqlMapExecutorDelegate.java:649)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryWithRowHandler(SqlMapSessionImpl.java:156)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryWithRowHandler(SqlMapClientImpl.java:133)
    at org.springframework.orm.ibatis.SqlMapClientTemplate$5.doInSqlMapClient(SqlMapClientTemplate.java:267)
    at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:165)
    at org.springframework.orm.ibatis.SqlMapClientTemplate.queryWithRowHandler(SqlMapClientTemplate.java:265)
    at org.myClass(myClass.java:83)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:66)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:516)

Am I using the wrong java data type for the value to be inserted? If not, why won’t MySQL let me insert the value?

  • 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-06-10T01:02:19+00:00Added an answer on June 10, 2026 at 1:02 am

    You appear to have misunderstood how defining a DECIMAL (or potentially NUMERIC) column works in SQL –
    Specifically, when defining the column as DECIMAL(x, y), x is the total number of digits the column will store, and y is the number of digits after the decimal point. So, in your column definition, you specified a range of -1 < column < 1. The datatype is correct, but you’re attempting to specify a value outside the range the column was told to allow.
    Fortunately, the fix is simple: change the column definition. I’m assuming you want to have up to 5 digits before the decimal point, which would make the column definition DECIMAL(10, 5).

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

Sidebar

Related Questions

I'm inserting a row using an Oracle stored procedure which is configured to use
I have a non-nullable database column which has a default value set. When inserting
Using C# in Visual Studio, I'm inserting a row into a table like this:
I have a problem inserting a row using Entity Framework with the MySQL Connector/NET
I have a table with an auto-incrementing ID. After inserting a new row, I
I'm using SQL Server 2005. I have a table whose row size should be
I have a table in database which has following structure(data) : +--------------------------+ Organization +--------------------------+
I am having a problem with inserting a new row in database using Doctrine
I am inserting a new row to the database table using Entity Framework, but
I am using oracle database While inserting a row in a table, i need

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.