You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Fabio Duo <fa...@swissonline.ch> on 2004/06/18 17:41:10 UTC

No Results from database

Hello,

I want to get some results from a mySQL Database. I do this trough a esql
logic sheet. But I don't receive error messages I simply don't get any
results. I have no idea what this could be. Does someone has a idea?

I have the relevant files in the mail(XSP-Page, Sitemap, cocoon.xconf,
web.xml, Browser output). 
The Database exists and is filled with content. 
It seems to me that that esql things are just ignored, because the no-result
content is also not displayed neither a error message.

Please help me, I am getting crazy.
Thanks a lot
Fabio


XSP - Page (news.xsp):

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
	<page>
		<content>
			<esql:connection>
 				 <esql:pool>mySQLTEST</esql:pool>
   					 <esql:execute-query>
    						<esql:query>SELECT * FROM
test</esql:query>
   		 					<esql:results>
    						    <esql:row-results>
 
<esql:get-string column="nr"/>
	
<esql:get-string column="txt"/>
						        </esql:row-results>
    						</esql:results>
  						<esql:no-results>
     							  Sorry, no results!
   					   </esql:no-results>
    				   <esql:error-results>
	
<xsp:attribute name="fatal-error"><xsp:get-message/></xsp:attribute>
	
<stacktrace><esql:get-stacktrace/></stacktrace>
					   </esql:error-results>
 				 </esql:execute-query>
  			</esql:connection>	
  		</content>
	</page>
</xsp:page>

Sitemap.xmap:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- CVS $Id: sitemap.xmap,v 1.13 2003/11/18 07:12:10 tony Exp $ -->
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
	
	<map:components>
	<map:transformer name="sql" logger="sitemap.transformer.sql"
src="org.apache.cocoon.transformation.SQLTransformer"/>
	
	</map:components>
	
	<!-- =========================== Pipelines
================================= -->
	<map:pipelines>
	 <map:pipeline>
	  <map:match pattern="test.xsp">
		<map:generate type="serverpages" src="news.xsp"/>
	    <map:serialize type="xml"/>
	  </map:match>
	</map:pipeline>
	</map:pipelines>
</map:sitemap>

Cocoon.xconf:

<jdbc name="mySQLTEST">
   	<pool-controller max="8" min="2"/>
 	<dburl>jdbc:mysql://localhost/da</dburl>
  	<user>root</user>
   	<password>alta</password>
 </jdbc>

Web.xml:

<init-param>
  <param-name>load-class</param-name>
  <param-value>org.gjt.mm.mysql.Driver</param-value>
</init-param>

Browser output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<page xmlns:xsp="http://apache.org/xsp"
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
		<content>
			
 				 
   					 	
  		</content>
	</page>