problem occurred when i try to insert a scientific word (like: 3.14E7 that represents 3140000.0 in double) into ms sql server 2000 database. it issues exception like "there's an exception happened when converting float value to numeric", which violated via sql 'null'. What may cause such exception. or what should i do therefore i can insert scientific word into database.
i appreciate any suggestion.
thank you very much.
jason
Hibernate version:
2.1.4
Mapping documents:
<class name="com.folder.entity.PersistenceClass" table="PersistenceClass" >
<composite-id ...>
......
</composite-id>
<property name="column1" type="java.lang.Double" column="COLUMN1" length="20"/>
<property name="column2" type="java.lang.Double" column="COLUMN2" length="20"/>
....
</class>
Code between sessionFactory.openSession() and session.close():
for the code is combined with springframework. so only have code like "getHibernateTemplate().save(Object)".
Full stack trace of any exception that occurs:
2004-09-08 08:50:31,182 [WARN] util.JDBCExceptionReporter - SQL Error: 8115, SQL
State: 22001
2004-09-08 08:50:31,182 [ERROR] util.JDBCExceptionReporter - [Microsoft][SQLServ
er 2000 Driver for JDBC][SQLServer]轉換 float 到資料型別 numeric 時發生算術溢位
錯誤。
2004-09-08 08:50:31,182 [WARN] util.JDBCExceptionReporter - SQL Error: 3621, SQL
State: HY000
2004-09-08 08:50:31,182 [ERROR] util.JDBCExceptionReporter - [Microsoft][SQLServ
er 2000 Driver for JDBC][SQLServer]陳述式已經結束。
2004-09-08 08:50:31,192 [ERROR] util.JDBCExceptionReporter - could not insert: [
com.folder.entity.PersistenceClass#com.folder.entity.PersistenceClassPK@cdc97b[KEY1=t,KEY2=tt]]
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]轉
換 float 到資料型別 numeric 時發生算術溢位錯誤。
...............
org.springframework.dao.DataIntegrityViolationException: (HibernateTemplate): da
ta integrity violated by SQL 'null'; nested exception is java.sql.SQLException:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]轉換 float 到資料型別 nume
ric 時發生算術溢位錯誤。
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]轉
換 float 到資料型別 numeric 時發生算術溢位錯誤。
Name and version of the database you are using:
MS Sql server 2000
Debug level Hibernate log excerpt:
|