[트러블] Cause: java.sql.SQLException: 부적합한 열 유형: 1111

jaeyong Lee·2024년 7월 18일
0

트러블 슈팅

목록 보기
6/15

org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #2 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 부적합한 열 유형: 1111

위에서 나온 sql 1111 에러는 Oracle Driver에서 연동할때 JdbcType.OTHER을 사용하면 null값을 받을 때 에러가 날 수 있다.

따라서 mybatis config설정에

<configuration>
    <settings>
        <setting name="jdbcTypeForNull" value="NULL" />
    </settings>
  
   <typeAliases>
    <typeAlias type="com.attiWell.goods.vo.GoodsVO" alias="goodsVO" />
    <typeAlias type="com.attiWell.goods.vo.ImageFileVO" alias="imageFileVO" />
    <typeAlias type="com.attiWell.member.vo.MemberVO" alias="memberVO" />
    <typeAlias type="com.attiWell.cart.vo.CartVO" alias="cartVO" />
    <typeAlias type="com.attiWell.order.vo.OrderVO" alias="orderVO" />
    <typeAlias type="com.attiWell.mypage.vo.MyPageVO" alias="mypageVO" />
    
  </typeAliases>
</configuration>

코드를 넣어주면 null값을 받을 수 있다. 추가적으로 typeAliases 위에 설정해야 한다.

0개의 댓글