eGovFrame 표준프레임워크 포털

메뉴 건너띄기
상단메뉴 바로가기
본문 바로가기

이 누리집은 대한민국 공식 전자정부 누리집입니다.

본문 영역

적용 지원, FAQ, Q&A 게시판을 통해 기술 문제 해결을 지원합니다.

묻고 답하기

oracle clob 조회시 null만 반환됩니다..
  • 작성자

    정*

  • 작성일

    2013-07-26 16:35:52

  • 조회수

    2,794

  • 구분

    실행환경

  • 진행상태

    완료

질문

안녕하세요~!~
환경은
전자정부2.5 자바1.5 톰캣6.0 오라클10g
상이구요

ibatis사용하는데 table을 조회 해오면 컬럼타입이 clob인 것만
null이 반환 됩니다..

insert를 하면 잘 들어가는데 select를 하면 null이 나와요.. ㅠ

쿼리는 첨부 하였습니다. 부탁드립니다. ~!~
context-sqlMap.xml 입니다.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">

<!-- lob Handler -->
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true" />

<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:/egovframework/egovProps/globals.properties</value>
</list>
</property>
</bean>

<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocations">
<list>
<value>classpath:/egovframework/sqlmap/config/${Globals.DbType}/*.xml</value>
</list>
</property>
<property name="dataSource" ref="dataSource-${Globals.DbType}"/>
<property name="lobHandler" ref="lobHandler"/>
</bean>
</beans>

첨부파일
답변

안녕하세요. 정철님.

sql-config.xml 상에 다음과 같은 typeHandler를 등록해 봐 주십시오.

<typeHandler callback="org.springframework.orm.ibatis.supportClobStringTypeHandler" jdbcType="CLOB" javaType="java.lang.String"/>

그럼, 즐거운 하루되십시오.
감사합니다.

이 페이지의 구성

묻고 답하기