You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Roger I Martin PhD <hy...@hypernexinc.com> on 2002/06/09 13:47:19 UTC

getBlob patch for esql

Hi,

I needed blobs.  I only added getBlob into a byte array.  Setting a blob works best if done with a prepared statement.  If there is interest I can put in PreparedStatement functionality.  The life span of a prepared statement may be short albeit it would allow Blobs to be pushed into a database.  If someone knows the future architecture of the esql logicsheet please let me know if there are any chunks of code needed.

cvs diff -u does not work on esql.xsl.
so that one was just cvs diff.

-Roger



Re: getBlob patch for esql

Posted by Roger I Martin PhD <hy...@hypernexinc.com>.
Ah! Ok.

> Don't see any other possibility, but then I haven't worked with BLOBs so
far.
> Only one would want to use <esql:parameter
type="blob"><xsp:expr>buffer</xsp:expr></esql:parameter>
I'll be look at this and push it along. It would be understood that the
input for the blob is a byte array.

> *Personnally,* I prefer insert/update/delete to happen in the sitemap
using
> the DatabaseActions. XSP is IMHO best for selects.
Got it.  I'll study the database actions. Thanks.

-Roger





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


Re: getBlob patch for esql

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 10.Jun.2002 -- 07:56 AM, Roger I Martin PhD wrote:
> Hi,
> 
> Testing today.
> 
> Perhaps because reading xsl format is not my strong suit, I am not seeing
> how the esql:parameter could help push a blob into a database.  I'll have to
> test.  I looked at the callable statement example

Oh no, it doesn't help. It's only that I wanted to point out that esql does
use PreparedStatements. There is no BLOB support.

> Object types by the esql:parameter. Blobs are an interface and ResultSets
> return them but when you need to set one, a significant implementation is
> required.

Agreed.

> If esql:parameter can do it then the Blob implementation would need to be
> present in the xsp; when you say it should be done in an action you mean
> there needs to be something like

*Personnally,* I prefer insert/update/delete to happen in the sitemap using
the DatabaseActions. XSP is IMHO best for selects.

> byte[] buffer=new byte[size];
> ....
> <esql:set-byte-array-as-blob>buffer<esql:set-byte-array-as-blob>
> ...

Don't see any other possibility, but then I haven't worked with BLOBs so far.
Only one would want to use <esql:parameter type="blob"><xsp:expr>buffer</xsp:expr></esql:parameter>

> Which is relevant:)  This way an xsp author need not have an implementation
> of a Blob lying around; It would be implemented and applied internally
> relieving an xsp author of the task.
> 
> Also with jdk1.4 there is the java.nio package which allows other arrays of
> primitives such as double to be treated as a byte array and can then be
> blobbed.  Therefore there could be esql:set-double-array-as-blob,
> esql:get-double-array-from-blob, etc.
> 
> I'm having good success with Cocoon; have data flowing from Blobs and
> queries to svg charts and graphs from a crystallography database which is
> output from a semiconductor metrology tool.  It is very fast and robust.
> Very close to applying the Java Advance Imaging JAI API to generate image
> and color contour plots from more scientific data.  The tool can be
> controlled and data can be viewed outside clean rooms with our Cocoon
> powered webapp.  I plan to develop a smaller illustration of what I am doing
> some time this year and provide it as a Cocoon example.

Sounds cool!

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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


Re: getBlob patch for esql

Posted by Roger I Martin PhD <hy...@hypernexinc.com>.
Hi,

Testing today.

Perhaps because reading xsl format is not my strong suit, I am not seeing
how the esql:parameter could help push a blob into a database.  I'll have to
test.  I looked at the callable statement example
...
<esql:call>{? = foo(<esql:parameter direction="in"
  type="Int"><xsp:expr>1</xsp:expr></esql:parameter>)}
</esql:call>
...
and it appears like primitives can be wrapped with their corresponding
Object types by the esql:parameter. Blobs are an interface and ResultSets
return them but when you need to set one, a significant implementation is
required.

If esql:parameter can do it then the Blob implementation would need to be
present in the xsp; when you say it should be done in an action you mean
there needs to be something like
byte[] buffer=new byte[size];
....
<esql:set-byte-array-as-blob>buffer<esql:set-byte-array-as-blob>
...
?
Which is relevant:)  This way an xsp author need not have an implementation
of a Blob lying around; It would be implemented and applied internally
relieving an xsp author of the task.

Also with jdk1.4 there is the java.nio package which allows other arrays of
primitives such as double to be treated as a byte array and can then be
blobbed.  Therefore there could be esql:set-double-array-as-blob,
esql:get-double-array-from-blob, etc.

I'm having good success with Cocoon; have data flowing from Blobs and
queries to svg charts and graphs from a crystallography database which is
output from a semiconductor metrology tool.  It is very fast and robust.
Very close to applying the Java Advance Imaging JAI API to generate image
and color contour plots from more scientific data.  The tool can be
controlled and data can be viewed outside clean rooms with our Cocoon
powered webapp.  I plan to develop a smaller illustration of what I am doing
some time this year and provide it as a Cocoon example.

Thanks,
Roger

----- Original Message -----
From: "Christian Haul" <ha...@dvs1.informatik.tu-darmstadt.de>
To: <co...@xml.apache.org>
Sent: Monday, June 10, 2002 5:06 AM
Subject: Re: getBlob patch for esql


> On 09.Jun.2002 -- 07:47 AM, Roger I Martin PhD wrote:
> > I needed blobs.  I only added getBlob into a byte array.  Setting a
>
> Thanks for your patch. Applied to HEAD. Please cross-check.
>
> > blob works best if done with a prepared statement.  If there is
> > interest I can put in PreparedStatement functionality.  The life span
>
> Could you explain this a bit more? ESQL uses PreparedStatements
> whenever a <esql:parameter/> is present in the query string.
>
> > of a prepared statement may be short albeit it would allow Blobs to be
> > pushed into a database.  If someone knows the future architecture of
> > the esql logicsheet please let me know if there are any chunks of code
> > needed.
>
> Storing BLOBs would be nice (although I believe it should be done in
> an action and not on a XSP, but that's irrelevant).
>
> Currently, no changes are planned.
>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>



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


Re: getBlob patch for esql

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 09.Jun.2002 -- 07:47 AM, Roger I Martin PhD wrote:
> I needed blobs.  I only added getBlob into a byte array.  Setting a

Thanks for your patch. Applied to HEAD. Please cross-check.

> blob works best if done with a prepared statement.  If there is
> interest I can put in PreparedStatement functionality.  The life span

Could you explain this a bit more? ESQL uses PreparedStatements
whenever a <esql:parameter/> is present in the query string.

> of a prepared statement may be short albeit it would allow Blobs to be
> pushed into a database.  If someone knows the future architecture of
> the esql logicsheet please let me know if there are any chunks of code
> needed.

Storing BLOBs would be nice (although I believe it should be done in
an action and not on a XSP, but that's irrelevant).

Currently, no changes are planned.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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