You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by To...@bull.net on 2002/03/14 18:25:36 UTC

patch for EQSL - clob support in esql:get-xml

Hello,

I've found that version <!-- $Id: esql.xsl,v 1.4 2002/01/28 09:37:16 tcurdt
Exp $--> still doesn't contain clob functionality in get-xml.
I would like to propose changes into esql.xsl which enables clob in
get-xml.
Priority: high (it was the first thing which I had to implement for Cocoon,
without it whole wonderful xsp is useless for us)

All changed lines or added are clearly marked with comment 'TB'. The main
change is to instead of calling directy the ResultSet.getString, put a
wrapper which
reads clob as string (if column is clob type) or in ohter case standard
getString (look at getStringOrClob function). The implementation is in xsl
but it would be better to move it to  EsqlHelper class (your decision).

Remark: I implemented own reading of clob because getAscii was somehow
producing converted/strange string.
     It works only when encoding for get-xml is not specified!!! I'm not
sure how to implement it in other case.

Test: code deeply tested and used more that 2 months. But tested only on
Oracle jdbc (shoudn't be worse for other driver).


Sorry for missing 'diff -u of CVS' but I'm not familiar with CVS. Instead
code is additionaly commented.


Please send me your opinion and state of the patch,

     Tomasz

(See attached file: esql.xsl)

patch for EQSL - clob support in esql:get-xml

Posted by tinu <ti...@email.ch>.
Tomasz.Bech@bull.net writes:
 > Remark: I implemented own reading of clob because getAscii was somehow
 > producing converted/strange string.
 >      It works only when encoding for get-xml is not specified!!! I'm not
 > sure how to implement it in other case.
 > 
 > Test: code deeply tested and used more that 2 months. But tested only on
 > Oracle jdbc (shoudn't be worse for other driver).

Just tested this enhancement, but I get problems with mysql. I will try to
localise the problem. At least it seems that the new version is not fully
compatible with the old one.

Nevertheless, thank's a lot for your contribution.

Cheers

Martin

-- 

Martin Lüthi
Dr. sc. nat.

wyona:research&development
hardstrasse 219
8005 Zürich

tel: 01 272 91 61
mel: martin.luethi@wyona.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


patch for EQSL - clob support in esql:get-xml

Posted by tinu <ti...@email.ch>.
Found! 

It seems that an exception is not caught appropriately within the esql.xsl,
which was not thrown in the older version. By inserting in my xsp a try
clause, everything works fine. I'll tried to include it into the esql.xsl, but
the nesting of expressions prohibited this (this incredible mix of XSLT and
Java)

my workaround in the xsp page is:

      <esql:connection>
        <xsp:logic> try{</xsp:logic>

        ===== here comes my database query =====

        <xsp:logic>
         }catch (Exception e){
            getLogger().error("Could not get String or Clob", e);
        }
        </xsp:logic>
      </esql:connection>

everything else seems to work fine with mysql.

Cheers 

Martin

-- 

Martin Lüthi
Dr. sc. nat.

wyona:research&development
hardstrasse 219
8005 Zürich

tel: 01 272 91 61
mel: martin.luethi@wyona.com

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org