cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: draft final version of the esql namespace
Date Tue, 07 Nov 2000 00:33:28 GMT
On Mon, 6 Nov 2000, Paul Russell wrote:

> > <esql:connection>
> >  <esql:driver>org.postgresql.Driver</esql:driver>
> >  <esql:dburl>jdbc:postgresql://localhost/test</esql:dburl>
> >  <esql:username>test</esql:username>
> >  <esql:password>test</esql:password>
> >  <esql:execute-query>
> >   <esql:query>select id,name from department_table</esql:query>
> >   <esql:results>
> >    <header>header info</header>
> >    <esql:row-results>
> >     <id><esql:get-int column="id"/></id>
> >     <name><esql:get-string column="name"/></name>
> >    </esql:row-results>
> >    <footer>footer info</footer>
> >   </esql:results>
> >   <esql:update-results>
> >    there were <esql:get-updated-rows/> rows updated
> >   </esql:update-results>
> >   <esql:error-results>
> >    the query failed for some reason: <esql:get-message/>
> >   </esql:error-results>
> >  </esql:execute-query>
> > </esql:connection>
> 
> Meta +1 from me. The only thing that occours to me is what
> if someone wants to use two connections at once? Can we dismiss
> this as something that people really should avoid anyway?
> (I don't really like the thought of people running what should
> be subqueries by using nested executes anyway, to be honest,
> so I don't think it's a major loss). Thoughts?

it's allowed by the current rules:

<esql:connection>
 <esql:driver>org.postgresql.Driver</esql:driver>
 <esql:dburl>jdbc:postgresql://localhost/test</esql:dburl>
 <esql:username>test</esql:username>
 <esql:password>test</esql:password>
 <esql:execute-query>
  <esql:query>select id,name from department_table</esql:query>
  <esql:results>
   <esql:row-results>
    <id><esql:get-int column="id"/></id>
    <name><esql:get-string column="name"/></name>
    <employees>
     <esql:connection>
      <esql:driver>org.postgresql.Driver</esql:driver>
      <esql:dburl>jdbc:postgresql://localhost/employees</esql:dburl>
      <esql:username>employees</esql:username>
      <esql:password>employees</esql:password>
      <esql:execute-query>
       ...
      </esql:execute-query>
     </esql:connection>
    </esql:connection>
   </esql:row-results>
  </esql:results>
 </esql:execute-query>
</esql:connection>

a similar configuration actually works with the current c1 and c2
logicsheets. i don't especially like it, and boy, it makes the code more
complex, but i think it's more or less mandatory.

- donald


Mime
View raw message