CLOB issue with JDBC, IBATIS and Oracle 10g

Discussion in 'Java' started by kartechy@googlemail.com, Sep 21, 2007.

  1. Guest

    Hi,

    I have some JAVA code to make connection and insert some data into
    Oracle 10g via Ibatis framework, its failing for CLOB data type, Can
    you please help me to resolve this ?

    see the JAVA code flow below

    FileA.java
    -------------

    SqlMapClient sqlMap = SQLConfig.getSqlMapInstance(); // this sqlconfig
    xml contains all the login details..
    sqlMap.StartTransaction();
    FileB_Object.setExampleText(myStringBuffer.toString()); // this file
    contains get/set methods
    sqlMap.insert("insertExampleText", FileB_Object);
    sqlMap.CommitTransaction();

    FileB.java
    -----------------
    private String exampleText;
    public String getExampleText() {
    return exampleText;
    }

    public void setExampleText(String exampleText) {
    this.exampleText =exampleText;
    }
    FileC.XML
    ----------------
    which contains all the SQLs , Properties , reference to FileB.Class -
    part of IBatis and I added the following line also.
    <result property="exampleText" column="exampleText" jdbcType="BLOB"/>

    The same code is working fine if the length is less than 4000 and
    failed for more than 4000 chars

    I am getting this error

    com.ibatis.common.jdbc.exception.NestedSQLException:
    --- The error occurred in c:\temp\FileC.xml.
    --- The error occurred while applying a parameter map.
    --- Check the insertExampleText-InlineParameterMap.
    --- Check the parameter mapping for the 'exampleText' property.
    --- Cause: java.sql.SQLException: Data size bigger than max size for
    this type: 7821
    Caused by: java.sql.SQLException: Data size bigger than max size for
    this type: 7821

    After this error I tried to change the "exampleText" as java.sql.CLOB
    in all the places - but its again failed and getting the same error

    Any help would be great

    Thanks

    Kart.
     
    , Sep 21, 2007
    #1
    1. Advertising

  2. wrote:
    > Hi,
    >
    > I have some JAVA code to make connection and insert some data into
    > Oracle 10g via Ibatis framework, its failing for CLOB data type, Can
    > you please help me to resolve this ?
    >


    Multiposted
    http://www.cs.tut.fi/~jkorpela/usenet/xpost.html
     
    RedGrittyBrick, Sep 21, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    10
    Views:
    12,180
    steve
    May 15, 2005
  2. Betty
    Replies:
    1
    Views:
    9,896
    Juha Laiho
    May 21, 2005
  3. Replies:
    0
    Views:
    2,496
  4. Replies:
    1
    Views:
    1,123
    bcoulson
    Aug 31, 2009
  5. Replies:
    0
    Views:
    755
Loading...

Share This Page