ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "De Gaetano Giuseppe" <degaet...@PITAGORA.IT>
Subject R: R: handling null values
Date Mon, 19 Feb 2007 16:14:59 GMT
com.ibatis.common.jdbc.exception.NestedSQLException:   

--- The error occurred in Pratica.xml.  

--- The error occurred while applying a parameter map.  

--- Check the insertPraticaOracle-InlineParameterMap.  

--- Check the parameter mapping for the 'descrizione' property.  

--- Cause: java.sql.SQLException: Tipo di colonna non valido

Caused by: java.sql.SQLException: Tipo di colonna non valido

      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:91)

      at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:446)

      at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)

      at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:60)

      at it.pitagora.pratica.dao.ibatis.IBatisPraticaDAO.insertPratica(IBatisPraticaDAO.java:152)

      at it.pitagora.test.TestCasePratica.testInsertPratica(TestCasePratica.java:127)

      at it.pitagora.test.TestCasePratica.main(TestCasePratica.java:161)

Caused by: java.sql.SQLException: Tipo di colonna non valido

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)

      at oracle.jdbc.driver.OracleStatement.get_internal_type(OracleStatement.java:6411)

      at oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:1358)

      at it.pitagora.util.pool.db.CachedPreparedStatement.setNull(CachedPreparedStatement.java:102)

      at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:171)

      at com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)

      at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:76)

      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:200)

      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:78)

      ... 6 more

 


-----Messaggio originale-----
Da: Giovanni Cuccu - CUP2000 [mailto:giovanni.cuccu@cup2000.it] 
Inviato: lunedì 19 febbraio 2007 16.18
A: user-java@ibatis.apache.org
Oggetto: Re: R: handling null values

can you post the oracle error code plus java stack trace along the sql 
executed from the ibatis log file?
Giovanni

> It is a copy and past error
> 
> -----Messaggio originale-----
> Da: Giovanni Cuccu - CUP2000 [mailto:giovanni.cuccu@cup2000.it] 
> Inviato: lunedì 19 febbraio 2007 15.15
> A: user-java@ibatis.apache.org
> Oggetto: Re: handling null values
> 
> ciao Giuseppe,
> 	is it a copy and paste error or did you forget the insert keyword in 
> the oracle sql?
> Giovanni
> 
>> Hi all,
>>
>>  
>>
>> I am developing an application which has to work with oracle and with mysql.
>>
>>  
>>
>> I am using two different queries because in case the value x3=null and I 
>> am using oracle I get an exception.
>>
>> In case I use mysql I don't have any exception.
>>
>> I would like to know if I made some mistake or it is normal.
>>
>>  
>>
>>   <insert id="insertXXXMySQL">
>>
>>      insert into XXX (x1, x2, x3, x4, x5, x6, x7)
>>
>>        values (#x1#, #x2#, #x3#, #x4#, #x5#, #x6#, #x7#)
>>
>>  </insert>
>>
>>  
>>
>>  <insert id="insertPraticaOracle">
>>
>>  into XXX (x1, x2
>>
>>             <dynamic>
>>
>>                         <isNotNull prepend="," property="x3">
>>
>>                            X3
>>
>>                    </isNotNull>
>>
>>             </dynamic>
>>
>>                         ,x4, x5, x6, x7)
>>
>>        values (#x1#, #x2#
>>
>>        <dynamic>
>>
>>                         <isNotNull prepend="," property="x3">
>>
>>                            #x3#
>>
>>                    </isNotNull>
>>
>>             </dynamic>
>>
>>             ,#x4#, #x5#, #x6#, #x7#)
>>
>>    </insert>
>>
>>  
>>
>>  
>>
>>  
>>
>>  
>>
> 
> 


-- 
Giovanni Cuccu
CUP 2000 Spa
Via del Borgo di S. Pietro, 90/c - 40126 Bologna
e-mail: giovanni.cuccu _at_ cup2000.it


Mime
View raw message