cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henning von Bargen <H.vonBar...@Triestram-Partner.de>
Subject AW: sql tag-library
Date Tue, 09 May 2000 07:11:23 GMT
Ricardos example is very useful.
Thanks, Ricardo!
It's concept seems to be quite similar to Oracle's XSQL servlet.
It would be useful to join the efforts with Oracle (Steve Muench) and maybe
to define a standard.
It's a bit confusing at this moment, we now have
SQL Processor, SQL taglib, Ricardos improved XSQL taglib, Oracle's XSQL
servlet and maybe other database-dependent libraries.
Is the term "XSQL" protected somehow?

Henning

> -----Urspr√ľngliche Nachricht-----
> Von:	Ricardo Rocha [SMTP:ricardo@apache.org]
> Gesendet am:	Montag, 8. Mai 2000 15:16
> An:	cocoon-users@xml.apache.org
> Betreff:	Re: sql tag-library
> 
> On Mon, 08 May 2000, MIchele Bianchi wrote:
> > i'm wondering about 2 ideas on the sql tag-library.  the first to
specify the
> > driver name in the config file (or smth like that) so it could be really
easy
> > to change the dbms.  the second one to have a choice specify a
dbconnection
> > or the dburl.  the db connection it's a really expensive operation it
seems
> > imho to create a global var and reuse it.  please tell me if it is
stupid, cos
> > i'm new in servlet programming.
> 
> During an improvised "Intro to XSP" course held in the tropical jungles of
> Colombia (South America), we came up with an example logicsheet that
> uses externally defined, named connection pools.
> 
> Note: while useful right out of the box, this logicsheet is meant to be
just
> an example of logicsheet authoring principles. Translated: it still
requires
> some polishing, :-)
> 
> This logicsheet allows you to execute any arbritrary SQL statement against
> a named connection pool:
> 
>   <!-- Get KING's data. 'myEmp' is mapped to a Hashtable -->
>   <xsql:select-into name="myEmp" use-connection="scott">
>     <xsql:statement>
>       SELECT * FROM emp WHERE ename = 'KING'
>     </xsql:statement>
>   </xsql:select-into>
> 
>   <!-- List all employees working with KING -->
>   <xsql:execute-query id="coworkers" use-connection="scott">
>     <xsql:statement>
>       SELECT *
>       FROM emp
>       WHERE deptno = <xsql:get-column from="myEmp" name="deptno"/>
>     </xsql:statement>
>    </xsl:execute-query>
> 
>   <!-- Raise salaries for KING's colleagues -->
>   </xsql:execute-update use-connection="scott">
>     <xsql:statement>
>       UPDATE emp
>       SET        sal = sal * 1.1
>       WHERE   job = '<xsql:get-column from="myEmp" name="deptno"/>'
>     </xsql:statement>
>   </xsql:execute-update>
> 
> This logicsheet simply wraps calls to static methods in a "library class"
> (XSQL.java) which is, in turn, based on Gefion Software's
> DBConnectionManager.
> 
> A simple live demo can be checked at:
> 
>     http://www.plenix.com/xsp/logicsheets/emp.xml
> 
> This page contains a link to a zip file containing the source code and
> an Oracle-based example which can be easily "ported" to other
> RDBMS's.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message