cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dave Cheseldine" <iss...@bangor.ac.uk>
Subject Re: cocoon 2: esql / Oracle
Date Thu, 05 Apr 2001 13:44:28 GMT

> >    <content>
> >
> >       <esql:execute-query inner-method="no">
> >
> >       <esql:use-connection>foo_connection</esql:use-connection>
> >
> >         <esql:query>select COMPANY from STOCKS</esql:query>
> >         <esql:results>
> >          <para><esql:get-string column="todays_high"/></para>
> >         </esql:results>
> >
> >       </esql:execute-query>
> >
> >    </content>

>    <content>
>
>       <esql:connection>
>         <esql:pool>foo_connection</esql:use-connection>
>         <esql:execute-query>
>
>           <esql:query>select COMPANY from STOCKS</esql:query>
>           <esql:results>
>            <esql:row-results>
>              <para><esql:get-string column="todays_high"/></para>
>            </esql:row-results>
>           </esql:results>
>
>       </esql:execute-query>
>       </esql:connection>
>
>    </content>
>
> There are three main differences:
> 1) addition of a root tag <esql:connection>, all <esql:execute-query>
>    inside that tag will share the same connection.
> 2) <esql:use-connection> has been changed to <esql:pool> and it is placed
>    as a child of <esql:connection> (makes sense doesn't it?).
> 3) The use of <esql:row-results> inside of <esql:results>.  There are
three
>    types of results you can expect from a query: <esql:row-results>,
>    <esql:no-results>, <esql:error-results>.  You can vary your output
based
>    on the type of result.
>
> > and the have added the following to cocoon.xconf
> >
> >   <datasources>
> >
> >      <component-instance name="foo_connection"
> > class="org.apache.avalon.util.datasource.JdbcDataSource">
> >        <pool-controller min="1" max="5"/>
> >        <dburl>jdbc:oracle:thin:mimix.bangor.ac.uk:1521:bangori</dburl>
> >        <user>scott</user>
> >        <password>catman</password>
> >     </component-instance>
> >
> >   </datasources>
>
> I don't know if you meant to place your user and password in the file, BUT
> the syntax is correct.
>
> > So far I haven't seen any sign that a connection to the database has
been
> > made.
> > Are there any other files that need to be changed?
>
> No.  Just fix your esql file.  Also, there is a log file in
> $CONTEXT/WEB-INF/logs/cocoon.log that will give you tons of debugging
info.
> If you can't seem to get something working, the messages in there will
help
> understand how cocoon works, and what errors it has received.
>
>
> PS: Make sure that the initial parameter "force-load" has the Oracle
driver
> class in there. The entries are white space and comma delimited.
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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