Language/C#
iBatis에서의 CLOB, BLOB 처리
Lohen
2016. 2. 4. 22:07
iBatis에서 Oracle CLOB, BLOB 넣고 빼기
우선 자바빈의 경우
우선 자바빈의 경우
- class Data{
- byte[] blobField;
- String clobField;
- }
데이터 Insert시 insert into table values( #blobField:BLOB#, #clobField:CLOB#) 로 넣으면 됨. 파리미터 맵을 써도 됨.
데이터 select 시 select blob, clob from table에서 resultClass로는 안 받아짐.
따로 resultMap을 써서 아래와 같은 매핑이 필요
<resultMap id="result" class="beanClassName">
<result property="clobField" column="clobField" jdbcType="CLOB"/>
<result property="blobField" column="blobField" jdbcType="BLOB"/>
</resultMap>
반응형