You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Nathan Maves <Na...@Sun.COM> on 2004/12/16 19:18:15 UTC

tricks with implicit parameters and custom type handlers

So I have my oracle CTH working perfect on queries but I can not get it  
to work with and insert.

I get the following

Exception in thread "main" java.lang.ExceptionInInitializerError
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:141)
     at  
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUni 
tTestRunner.java:204)
     at  
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUni 
tTestRunner.java:177)
     at  
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUni 
tTestRunner.java:651)
     at  
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitT 
estRunner.java:558)
Caused by: com.ibatis.dao.client.DaoException: Error executing update.   
Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in  
reporting/viewer/dao/ibatis/mapping/Report.xml.
--- The error occurred while applying a parameter map.
--- Check the insertReport-InlineParameterMap.
--- Check the parameter mapping for the 'blob' property.
--- Cause: java.sql.SQLException: Data size bigger than max size for  
this type: 294231
Caused by: java.sql.SQLException: Data size bigger than max size for  
this type: 294231
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in  
reporting/viewer/dao/ibatis/mapping/Report.xml.
--- The error occurred while applying a parameter map.
--- Check the insertReport-InlineParameterMap.
--- Check the parameter mapping for the 'blob' property.
--- Cause: java.sql.SQLException: Data size bigger than max size for  
this type: 294231
Caused by: java.sql.SQLException: Data size bigger than max size for  
this type: 294231


<insert id="insertReport" parameterClass="DetailReport">
         INSERT INTO
             rv_report_hierarchy (
                 report_id,
                 parent_id,
                 report_name,
                 frequency_id,
                 archive_ind,
                 description,
                 report_type,
                 brio_job_id,
                 hierarchy_code,
                 report,
                 posted_date,
                 last_update_date
                 )
             values (
                 #id#,
                 #parentId#,
                 #name#,
                 #frequency#,
                 #archive#,
                 #description#,
                 #type#,
                 #brioJobId#,
                 #hierarchyCode#,
                 #blob:BLOB#,
                 sysdate,
                 sysdate
             )
     </insert>

Any ideas?


Re: tricks with implicit parameters and custom type handlers

Posted by Nathan Maves <Na...@Sun.COM>.
FIXED!

Turned out not to be a problem after all.  I was able to insert using  
the BlobHandler that has been posted.  But there was a catch.  I had to  
get the latest 10g driver from oracle.  Not sure why, since I am on 9i,  
but it resolved the max size problem.

Nathan

On Dec 16, 2004, at 11:18 AM, Nathan Maves wrote:

> So I have my oracle CTH working perfect on queries but I can not get  
> it to work with and insert.
>
> I get the following
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
>     at java.lang.Class.forName0(Native Method)
>     at java.lang.Class.forName(Class.java:141)
>     at  
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUn 
> itTestRunner.java:204)
>     at  
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUn 
> itTestRunner.java:177)
>     at  
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUn 
> itTestRunner.java:651)
>     at  
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnit 
> TestRunner.java:558)
> Caused by: com.ibatis.dao.client.DaoException: Error executing update.  
>  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in  
> reporting/viewer/dao/ibatis/mapping/Report.xml.
> --- The error occurred while applying a parameter map.
> --- Check the insertReport-InlineParameterMap.
> --- Check the parameter mapping for the 'blob' property.
> --- Cause: java.sql.SQLException: Data size bigger than max size for  
> this type: 294231
> Caused by: java.sql.SQLException: Data size bigger than max size for  
> this type: 294231
> Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in  
> reporting/viewer/dao/ibatis/mapping/Report.xml.
> --- The error occurred while applying a parameter map.
> --- Check the insertReport-InlineParameterMap.
> --- Check the parameter mapping for the 'blob' property.
> --- Cause: java.sql.SQLException: Data size bigger than max size for  
> this type: 294231
> Caused by: java.sql.SQLException: Data size bigger than max size for  
> this type: 294231
>
>
> <insert id="insertReport" parameterClass="DetailReport">
>         INSERT INTO
>             rv_report_hierarchy (
>                 report_id,
>                 parent_id,
>                 report_name,
>                 frequency_id,
>                 archive_ind,
>                 description,
>                 report_type,
>                 brio_job_id,
>                 hierarchy_code,
>                 report,
>                 posted_date,
>                 last_update_date
>                 )
>             values (
>                 #id#,
>                 #parentId#,
>                 #name#,
>                 #frequency#,
>                 #archive#,
>                 #description#,
>                 #type#,
>                 #brioJobId#,
>                 #hierarchyCode#,
>                 #blob:BLOB#,
>                 sysdate,
>                 sysdate
>             )
>     </insert>
>
> Any ideas?
>