ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Closed: (IBATIS-309) Cannot insert into Database Blob using IBATIS DAO
Date Sat, 22 Mar 2008 02:57:29 GMT

     [ https://issues.apache.org/jira/browse/IBATIS-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Clinton Begin closed IBATIS-309.

    Resolution: Won't Fix

Was a driver issue

> Cannot insert into Database Blob using IBATIS DAO
> -------------------------------------------------
>                 Key: IBATIS-309
>                 URL: https://issues.apache.org/jira/browse/IBATIS-309
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: DAO, SQL Maps
>    Affects Versions: 2.1.7
>         Environment: Windows 2000, Oracle Application Server and latest version of IBATIS
>            Reporter: sunil kumar
> I am using Oracle Application Server 10g( with latest version of IBatis. I
am uploading a file and inserting file data as byte[] in the database field which is a Blob.
I keep on getting SQLException:Data size bigger than max size for this type when i try to
insert. If i take out the file data from my insert statement , a record is inserted into the
> My xml mapping file is:
> code:
> --------------------------------------------------------------------------------
> <!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="testblob"> 	<typeAlias alias="testForm" type="gov.usaid.testblob.domain.TestForm"
/> 	<resultMap id="testFileResult" class="testForm">	 	<result property="fileId"
    column="FILE_ID" />	    <result property="fileType" column="FILE_TYPE" /> 	 
<result property="fileName"   column="FILE_NAME" />	 	<result property="fileData"
  column="FILE_DATA"  jdbcType="BLOB"/>		<result property="fileSize"   column="FILE_SIZE"/>
						</resultMap>	<!--  <select id="downloadFile" resultMap="testFileResult"
parameterClass="string">		select * from test_file where file_id=#value#	</select>-->
<insert id="saveFile" parameterClass="testForm">	  <selectKey resultClass="int" keyProperty="fileId">
		select SQ_REF_FILE_ID.nextval as FILE_ID from dual	  </selectKey>		insert into TEST_FILE
(FILE_ID,FILE_TYPE,FILE_NAME,FILE_SIZE,FILE_DATA)		values (#fileId#, #fileType:VARCHAR#, #fileName#,
#fileSize#,#fileData#)	</insert>			</sqlMap>    

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message