Oracle JDBC 10g Driver

Clob문제를 해결한 후 좀 더 살펴보기로 했다.

첫번째는 OraclePreparedStatementsetStringForClob() method가 32765 bytes 보다 큰 데이타를 insert 할 수 있게 해준다.

두번째는 Connection properties에 SetBigStringTryClob 속성을 true로 지정해주고 PreparedStatement의 setString()을 그대로 사용해줘도 된다.

// Populate the property object to hold the username, password and
// the new property 'SetBigStringTryClob' which is set to true. Setting
// this property allows inserting of large data using the existing
// setString() method, to a CLOB column in the database.
clobManipulationIn10g.props.put("user", clobManipulationIn10g.user );
clobManipulationIn10g.props.put("password", clobManipulationIn10g.password);
clobManipulationIn10g.props.put("SetBigStringTryClob", "true");
전체 예제

ibatis 의 sqlMap-config.xml에서
<property name="Driver.SetBigStringTryClob" value="true"/>를 제거하고 테스트해본 결과 정상작동하는 것으로 보아 내부적으로 첫번째 방식을 사용하고 있는 듯하다.


결론적으로
1. Oracel Database Server의 버젼이 10g가 아니더라도 JDBC Driver에 따라 Clob를 간단히 처리 할수가 있다.(다만 구축환경에 따라 다를수는 있다)

2. JDBC 10g Driver의 버젼에 따라 버그가 있는 듯하니 최신버젼을 사용하는게 좋다.
by 와따 | 2007/12/14 13:53 | Java | 트랙백 | 덧글(0)
트랙백 주소 : http://watta.egloos.com/tb/3529966
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]

:         :

:

비공개 덧글



<< 이전 페이지 다음 페이지 >>