I have been struggling to get ESQL working... I had thought it was the database setup, 
but turns out that is OK (see below) - now I am stuck again.

Following previous suggestions, I have tried to get an equivalent of the sample code 
shippped wiht Cocoon working.  I could not find any ESQL to test, so I used the the 
SQL code instead - it worked!  But the - as far as I can see - equivalent code in ESQL 
does not work.

I hope someone with a sharp pair of eyes can see why the first sample would work, and 
the next one not??

Thanks!
Derek



<!-- WORKING -->

<?xml version="1.0"?>

<?cocoon-process type="sql"?>

<page>

 <connectiondefs>
  <connection name="foo_connection">
   <driver>org.gjt.mm.mysql.Driver</driver>
  <dburl>jdbc:mysql://myhost.com/est</dburl>
  <username>est</username>
  <password>est</password>
  </connection>
 </connectiondefs> 
 
 <query connection="foo_connection">
  select * from computer
 </query>

<mysql>SELECT * FROM computer</mysql> 

</page>


<!-- NOT WORKING??? -->

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet type="text/xsl" href="one_computer.xsl"?>

<xsp:page
  xmlns:xsp="http://www.apache.org/1999/XSP/Core";
  xmlns:esql="http://apache.org/cocoon/SQL/v2";
  xmlns:request="http://www.apache.org/1999/XSP/Request"; 
>

<page>

<esql:connection>
  <esql:driver>org.gjt.mm.mysql.Driver</esql:driver>
  <esql:dburl>jdbc:mysql://myhost.com/est</esql:dburl>
  <esql:username>est</esql:username>
  <esql:password>est</esql:password>
        
  <esql:execute-query>
    <esql:query>SELECT * FROM computer</esql:query>
        
    <esql:results>
      <esql:row-results>
        <computer>
        <system><esql:get-string column="System"/></system>
        </computer>
      </esql:row-results>
    </esql:results>
    
    <esql:no-results>
      <computer>
         <system>No computer</system>
      </computer>
    </esql:no-results>    
                                
  </esql:execute-query>
                
</esql:connection>

<mysql>SELECT * FROM computer</mysql> 

</page>

</xsp:page>



---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to