Announcement Announcement Module
Collapse
No announcement yet.
Character to numeric conversion error on java.lang.Double Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Character to numeric conversion error on java.lang.Double

    Hi,
    I know it's maybe more a hibernate question, but we are using Spring's HibernateTemplate , so maybe you can help.
    I have a quite simple configuration (and problem):
    In the POJO object (InputTransactionLNC.java) there are java.lang.Double types. I'm using Informix database, where the attributes in table aro of FLOAT types.
    When I try to save an instance, where these Double are filled,
    I got an Char to numeric SQLException (see below).

    I tried to map the double attribute to java.lang.Double/didn't specify the type, but neither of those works (ends up with exception).

    any ideas? thank you


    Hibernate version: 2.1.8

    Mapping documents:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
    <hibernate-mapping package="cz.aura.isl.katalog.davky.domain.transact ion.ldics">

    <class name="InputTransactionLNC" table="kdiclnc" polymorphism="explicit">

    <id
    name="DCN"
    type="java.lang.String"
    column="kdcn">
    <generator class="assigned"/>
    </id>






    <property name="brutto"
    column="brutto"
    />

    </class>
    </hibernate-mapping>




    Code between sessionFactory.openSession() and session.close():

    Full stack trace of any exception that occurs:
    SEVERE: Could not synchronize database state with session
    org.springframework.jdbc.UncategorizedSQLException : Hibernate operation: could not insert: [cz.aura.isl.katalog.davky.domain.transaction.ldics .InputTransactionLNC#WSWZ0419133333332]: encountered SQLException [Character to numeric conversion error]; nested exception is java.sql.SQLException: Character to numeric conversion error
    java.sql.SQLException: Character to numeric conversion error
    at com.informix.util.IfxErrMsg.getSQLException(IfxErr Msg.java:355)

    onTearDown: cz.aura.isl.katalog.dao.impl.InputTransactionLNCDA OImplTest
    tearDown: cz.aura.isl.katalog.davky.AuraFastDatabaseTestCase
    at com.informix.jdbc.IfxSqli.addException(IfxSqli.jav a:3086)
    at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.jav a:3396)
    at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java :2259)
    at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.j ava:2179)
    at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.j ava:721)
    at com.informix.jdbc.IfxResultSet.executeUpdate(IfxRe sultSet.java:305)
    at com.informix.jdbc.IfxStatement.executeUpdateImpl(I fxStatement.java:882)
    at c



    Name and version of the database you are using:
    Informix (version don't know)


    The generated SQL (show_sql=true):
    INFO: Not binding factory to JNDI, no JNDI name configured
    Hibernate: insert into kdiclnc (ktrida, kskup, id_kcch6, id_kpolkat, id_kcprumt, i_kmjedn, j_kmjedn, k_kmjedn, m_kmjedn, l_kmjedn, sosmc, adpeic, kmeny, cena, pmic, aac, cicc, qupc, kodziv, narec, usi, objem, vyska, sirka, delka, kangnaz, kprfak, hmnapl, hmvybu, netto, brutto, kdvzt, knsoub, naz, dmlc, kiig, knazmat, rpdmrc, tidpol, kmoeext, kmoeint, kkstdic, kdcn) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
    16.6.2005 11:26:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions





    Debug level Hibernate log excerpt:
Working...
X