You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Edas Pazera <ed...@usa.net> on 2000/04/05 05:41:14 UTC
SQL example
When I execute a SQL example, I get the same XML back with the Cocoon footer
added. I assume I should have received an XML structure instead.
Is this an indication that SQL Processor is not being called? What should I
try?
I do have "processor.type.sql =
org.apache.cocoon.processor.sql.SQLProcessor" specified in cocoon.properties
file. The direct query against the database itself returns values, so it is
not a database problem either.
For the reference, the code I am trying is:
<?xml version="1.0"?>
<?cocoon-process type="sql"?>
<?cocoon-format type="text/xml"?>
<page>
<connectiondefs>
<connection name="foo_connection">
<driver>org.gjt.mm.mysql.Driver</driver>
<dburl>jdbc:mysql://localhost/mydb</dburl>
<username></username>
<password></password>
</connection>
</connectiondefs>
<query connection="foo_connection">
select ID from address
</query>
</page>
Thanks,
Edas
Re: SQL example
Posted by Laura Kruse <lm...@cis.ksu.edu>.
You need to add the xslt processor below the sql line, that should fix
you problem.
eg.
<?cocoon-process type="sql"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="news.xsl" type="text/xsl"?>
- Laura
Edas Pazera wrote:
>
> When I execute a SQL example, I get the same XML back with the Cocoon footer
> added. I assume I should have received an XML structure instead.
>
> Is this an indication that SQL Processor is not being called? What should I
> try?
>
> I do have "processor.type.sql =
> org.apache.cocoon.processor.sql.SQLProcessor" specified in cocoon.properties
> file. The direct query against the database itself returns values, so it is
> not a database problem either.
>
> For the reference, the code I am trying is:
>
> <?xml version="1.0"?>
>
> <?cocoon-process type="sql"?>
> <?cocoon-format type="text/xml"?>
>
> <page>
>
> <connectiondefs>
> <connection name="foo_connection">
> <driver>org.gjt.mm.mysql.Driver</driver>
> <dburl>jdbc:mysql://localhost/mydb</dburl>
> <username></username>
> <password></password>
> </connection>
> </connectiondefs>
>
> <query connection="foo_connection">
> select ID from address
> </query>
>
> </page>
Re: SQL example
Posted by Donald Ball <ba...@webslingerZ.com>.
On Tue, 4 Apr 2000, Edas Pazera wrote:
> When I execute a SQL example, I get the same XML back with the Cocoon footer
> added. I assume I should have received an XML structure instead.
>
> Is this an indication that SQL Processor is not being called? What should I
> try?
Yes. SQL Processor's error reporting isn't very good. Look in your servlet
engine's jvm error logs for the exception's stack trace. Almost certainly
it's "failure to connect to data source" or some variation on that.
>
> org.apache.cocoon.processor.sql.SQLProcessor" specified in cocoon.properties
> file. The direct query against the database itself returns values, so it is
> not a database problem either.
>
> For the reference, the code I am trying is:
>
> <?xml version="1.0"?>
>
> <?cocoon-process type="sql"?>
> <?cocoon-format type="text/xml"?>
>
> <page>
>
> <connectiondefs>
> <connection name="foo_connection">
> <driver>org.gjt.mm.mysql.Driver</driver>
> <dburl>jdbc:mysql://localhost/mydb</dburl>
> <username></username>
> <password></password>
> </connection>
> </connectiondefs>
>
> <query connection="foo_connection">
> select ID from address
> </query>
>
> </page>
Try omitting the username and password elements - empty string is
different than null.
- donald