2017-02-21 11 views
1

次のリンクで解決策を試して、CLOB OUTパラメータを処理しようとしています。 oracle clobsを処理するためのreturnTypeは何ですか?私は、ロブの取り扱いを除いて、ドキュメンテーションでその参照を参照していませんでした。Oracle Clobのストアド・プロシージャOutBound Gatewayの戻り値の型?

Previous Question - Handling OUT Array Params

<bean id="clobSqlReturnType" class=org.springframework.integration.jdbc.storedproc.?></bean> 


<int-jdbc:stored-proc-outbound-gateway 
    id="outbound-gateway-function-dbms" request-channel="procedureDBMSRequestChannel" 
    data-source="dataSource" 
    is-function="true" 
    stored-procedure-name="get_dbms_output2" 
    expect-single-result="true"> 
    <int-jdbc:sql-parameter-definition name="c1" type="CLOB" type-name="" direction="OUT" return-type="clobSqlReturnType" />  
</int-jdbc:stored-proc-outbound-gateway> 

答えて

0

一切すぐに解決策はありません。あなたは何か自分で行うべきです。このように:

public class ClobSqlReturnType implements SqlReturnType { 

    @Override 
    public Object getTypeValue(CallableStatement cs, int paramIndex, int sqlType, String typeName) throws SQLException { 
     Clob clob = cs.getClob(paramIndex); 
     return clob != null ? clob.getSubString(1, (int) clob.length()) : null; 
    } 
} 
+0

ありがとうございました。私はそれを使用しているコードサンプルであなたのゲートウェイテスト手順を見ましたが、それがすでに広告タイプであったかどうかは分かりませんでした。 – haju

関連する問題