Thanks so much!  This is just a one-time project thing; no real necessity
for portability.  I ended up doing this code inside ResultImpl.java, and it
worked perfectly. Thank you again,

James

----- Original Message -----
From: "Mike Cantrell" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, December 17, 2002 11:52 AM
Subject: Re: CLOBS and the EL


> The JSTL sql tag simply saves the ResultSet's .getObject() method and
> when you iterate through the rows, c:out calls the object's .toString()
> method. Oracle's implementation of the Clob object does not override the
> Object's .toString() method to produce the field's value. You must do
> something like:
>
>   /**
>    * Returns the Clob object as a String Object
>    */
>   public static String clobToString(Object clob) throws SQLException {
>     if (clob != null && clob instanceof Clob) {
>       long length = ((Clob)clob).length();
>       return ((Clob)clob).getSubString(1, (int)length);
>     }
>     else {
>       return null;
>     }
>   }
>
>
> I don't think it would be very portable to do this inside the JSTL code.
>
> Just my  ++cents
>
>
>
> James Smith wrote:
>
> >Hello.  I'm using the Jakarta JSTL tags (1.0.2) within Tomcat 4.1.12,
with
> >JDK 1.4.0 on a Windows platform.  I'm using the SQL tags to get large
text
> >fields from an Oracle database and Oracle sends back those fields as
CLOBs,
> >not as strings.  When putting the data into the pageContext, the EL
decides
> >that the CLOBs are not strings and therefore acts as if the CLOBs were
> >beans.  Is there an easy way to get the EL to turn the CLOBs into strings
> >automatically, or, if there isn't, can anyone point me to the proper
.java
> >file in the JSTL source code so I can jimmy with it there?  Thanks,
> >
> >James
> >
> >
> >--
> >To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to