我使用 SpringJdbcTemplate
运行插入 SQL 语句。我要插入的字段是NUMBER
. 值为:-0.11111111
类型float
。但是,在插入 DB 后,我得到的值是用 random numbers 填充的-0.1111111119389534
。
请注意,当我使用直接 JDBC 时,该值按原样插入,没有填充数字。
我使用BeanPropertySqlParameterSource
andMapSqlParameterSource
来设置 INSERT 语句的参数,两者都给出相同的结果。代码如下所示:
BeanPropertySqlParameterSource params = new BeanPropertySqlParameterSource(stat);
int n = jt.update(query, params);
其中 jt 是 的瞬间SimpleJdbcTemplate
。
数据库是甲骨文。
谢谢你。