cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: ESQL installation
Date Wed, 06 Dec 2000 05:52:33 GMT
On Wed, 6 Dec 2000, Matthew Cordes wrote:

> I too would like to know this as well as:
>
> 	1.	Is the version of esql supplied with cocoon-1.8 out of date?

yes.

>
> 	2.	Can the cvs version simply be added to cocoon-1.8 ( when I tried
> 	this it requires
> org.apache.turbine.services.db.PoolBrokerService
> 	which doesn't appear to be part of turbine-pool.jar (even the cvs
> 	version ).

yes it can, and the turbine-pool.jar in cvs certainly does contain this
class.

> 	3.	Does the version of esql supplied with 1.8 allow one to
> 	insert/update as well as select from db? If so, could you
> 	post some sample code?

yes.

<esql:connection>
  ...
  <esql:execute-query>
    <esql:query>insert into my_table (id,name) values (
      <esql:parameter type="int">1</esql:parameter>,
      <esql:parameter><request:get-parameter name="name"/></esql:parameter>
    </esql:query>
    <esql:update-results>
      <message>there were <esql:get-update-count/> rows updated</message>
    </esql:update-results>
  </esql:execute-query>
</esql:connection>

(note i just checked in support for esql:get-update-count - i'd
inadvertantly left it out of cvs. note also that the esql:parameter
elements are only if you want to use prepared statements - you can just as
easily put expressions right inside the esql:query element, but you lose
the type checking, conversion, and string escaping that comes with
prepared statements).

- donald


Mime
View raw message