cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: ESQL Extension
Date Wed, 09 Jan 2002 16:53:47 GMT
On 09.Jan.2002 -- 10:18 AM, Durrant, Peter wrote:
> Hi
> I've made some changes to ESQL to handle calls to stored procedures. At the

A more and more common request :-)

> moment it is limited to calling stored procedures that generate
> java.sql.resultSet output - i.e. SELECT. More work needs to be done to
> handle stored procedures that return other types of data. However, might
> this be beyond the scope of what was originally envisaged for ESQL?

Currently, we don't even do CallableStatements. (I have some patches
to that respect but haven tested them, yet. First, I'll need to create
some SPs to test against...)

> The reason I've made this change is because Oracle wasn't returning a
> resultSet as part of a normal query call to a stored procedure. 
> If this code is useful to extend ESQL then I'll happily submit it. So
> 	(1) are other people interested in the functionality?


> 	(2) who do I need to talk to about syntax etc. of the ESQL stored
> procedure functionality?

this group

> 	(3) how do I go about submitting my changes? I guess someone should
> look at the changes I've made...
> This is my first contribution to open source and I'm not sure if there's an
> ethical code submission process. :-)

post a diff -u against HEAD (cvs version) to this group

> The (brief) details of the changes are:
> 	(1) addition of CallableStatement to the EsqlQuery class and
> corresponding import

The problem I see here is that you'd need to cater for SPs that don't
have "out" parameters. So perhaps <call/> instead of <query/> could be
used to distinguish.

> 	(2) an <esql:stored-proc> added to the spec -- this was added to
> distinguish between prepared statements and stored procedure calls. This
> could perhaps be improved - comments would be welcome on this. Maybe add
> this as an attribute of <esql:query>?

see above. I'd rather not use a tag after spec'ing the query / call to
do the right thing(tm).

> 	(3) a direction attribute was added for stored procedure parameters


> 	(4) addition of code to handle stored procedure statement
> construction


> 	(5) if the query was of an "Oracle"-type, then the getting of the
> resultSet was changed to a statement.getObject call. This assumes that the
> output type is derived from resultSet.

need to see this to understand it.

> I've now implemented a call to stored procedures to look like:
>  - (the function is called get_titles and returns an Oracle cursor and takes
> an integer parameter)

>  - (you can see the "hack" of the <esql:stored-proc/> tag. Could this be
> made an attribute of <esql:query>? At the moment it is used to distinguish
> between a prepared statement and stored procedure call)

see above.


C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

To unsubscribe, e-mail:
For additional commands, email:

View raw message