ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sheldon A. Brown" <sheld...@gmail.com>
Subject Re: Oracle CLOB and IBatis
Date Wed, 27 Jun 2007 20:07:18 GMT
On 6/27/07, Tony Selke <tony.selke@gmail.com> wrote:
> So the BLOBs work with this format.  I need to try this same thing again
> with CLOBs.  The CLOBs are character data, not binary data, and should come
> back as a string instead of a byte-array (according to the documentation),
> but maybe I should try this again with your way below.  I think I was using
> "CLOB" (all upper case).  You are using "Blob" (Pascal-case) and maybe if I
> use "Clob" it will work.
>
> Tony


Thanks for the inspiration.  I was able to get it to work.

Key points:
- You need the latest oracle driver.  I'm using 10.2.0.1.
- You need providers.config to use this driver, not the Microsoft
version.  It should look something like this:
  <provider
    name="oracle10.2.0.100"
    description="Oracle, oracle provider V10.2.0.100"
    enabled="true"
    assemblyName="Oracle.DataAccess, Version=10.2.0.100,
Culture=neutral, PublicKeyToken=89b483f429c47342"
connectionClass="Oracle.DataAccess.Client.OracleConnection"
    commandClass="Oracle.DataAccess.Client.OracleCommand"
    parameterClass="Oracle.DataAccess.Client.OracleParameter"
    parameterDbTypeClass="Oracle.DataAccess.Client.OracleDbType"
    parameterDbTypeProperty="OracleDbType"
    dataAdapterClass="Oracle.DataAccess.Client.OracleDataAdapter"
    commandBuilderClass="Oracle.DataAccess.Client.OracleCommandBuilder"
    usePositionalParameters="true"
    useParameterPrefixInSql="true"
    useParameterPrefixInParameter="true"
    parameterPrefix=":"
    useDeriveParameters="false"
    allowMARS="false"
  />

- Clob -> String (and back) works!  You simply need to specify the
dbType on a resultMap (not a parameter thankfully).
  <resultMaps>
    <resultMap id="PerformanceMeasure-result" class="DBPersist.PerformanceMeasur
e, DBPersist">
      <result property="ID" column="ID"/>
      <result property="CalculationMethod" column="CalculationMethod" dbType="Cl
ob"/>
      </resultMap>
  </resultMaps>

I've tested this up to ~32K of data, so its good enough for my needs.

Sheldon

Mime
View raw message