-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: How to insert scientific word through Hibernate into db
PostPosted: Tue Sep 07, 2004 9:29 pm 
Newbie

Joined: Thu Mar 11, 2004 11:20 pm
Posts: 9
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:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.