Announcement Announcement Module
Collapse
No announcement yet.
DB precision padded with random numbers using Spring JdbcTemplate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • DB precision padded with random numbers using Spring JdbcTemplate

    I use Spring's JdbcTemplate to run an insert SQL statement. The field I want to insert into is a NUMBER. The value is: -0.11111111. However, after insertion into DB, the value I get is padded with random numbers -0.1111111119389534.

    Note that when I use direct JDBC, the value is inserted as it is, without the padded numbers.

    I use BeanPropertySqlParameterSource and MapSqlParameterSource for setting the parameters of the INSERT statement, both giving same results. The code looks like this:

    Code:
    BeanPropertySqlParameterSource params = new BeanPropertySqlParameterSource(stat);
    int n = jt.update(query, params);
    where jt is an instant of SimpleJdbcTemplate.

    The DB is Oracle.

    Thank you.
Working...
X