cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcus Crafter <craft...@dresdnerbank.de>
Subject [C2] esql connections diff
Date Wed, 01 Nov 2000 17:04:24 GMT
Hi All,

	Hope everything is going well around the C2 globe.

	Attached is a patch that makes a change to the abilities of the esql
	taglib.

	Background: In our environment we are interfacing to a legacy database
	with a combination of stored procedures and select's.
	
	In our particular case, stored procedures generate temporary tables
	which are valid only for the current database session. They are
	automatically deleted afterwards. Our typical use of the database is
	to call a stored procedure and then do a select on this temporary table.

	The issue is that both the stored procedure invocation and select need
	to be done with the same jdbc 'Connection' object, otherwise the
	temporary table will be already deleted before the sql 'select' starts.

	Currently the esql taglib uses a separate connection object for each
	query causing us all sorts of bother. The attached patch allows the
	user to specify more than one <esql:query>..</esql:query> inside a
	<esql:execute-query> tag. The <esql:query>'s are then executed using
	the same 'Connection object'.

	eg:

<esql:execute-query inner-method="no">

	<esql:driver>...</esql:driver>
	<esql:dburl>...</esql:dburl>
	<esql:username>...</esql:username>
	<esql:password>...</esql:password>

	<!-- first query executing stored procedure -->
	<esql:query>
		execute procedure ...
	</esql:query>

	<!-- second query performing select -->
	<esql:query>
		select ...
	</esql:query>

	<esql:results>
		<ROW>
			<esql:get-columns/>
		</ROW>
	</esql:results>

</esql:execute-query>

	2 things to be aware of though - the results are those from the last
	query; all others are dumped (not so bad), however the 'last' query
	may be xslt implementation dependant (ie. is the parse order of a
	stylesheet defined ?).

	Any suggestions or improvements are welcomed.

	Cheers,

	Marcus
	
-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : Marcus.Crafter@osa.de
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:           After Hours    : +49 69 49086750

Mime
View raw message