cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Picton Phillipps <>
Subject Problem connecting to MySQL
Date Fri, 18 Jun 2004 17:39:41 GMT
Dear Listers,
I am a newbie with Apache Cocoon and am trying my hand connecting to a MySQL
database, with some difficulty. I have researched alot and still cannot find
the answer to this problem. 

First the background info: 

Cocoon 2.1.5
Tomcat 5.0.27

I have adjusted the following files to setup a database connection to MySQL:

  		<jdbc name="ward_connect">
  			<pool-controller min="5" max="10"/>

		<!--For SQL Database Driver-->


			<map:match pattern="sqlconnect">
				<map:generate src="sqlextract.xml"/>
				<map:transform type="sql">
					<map:parameter name="use-connection"
				<map:serialize type="xml"/>

......and am using this xml file to describe the SQL query and also to
describe the connection parameters again:


<?xml version="1.0" encoding="UTF-8"?>
	<sql:execute-query xmlns:sql="">
			select admin_name from wards;

I have copied the mysql-connector-java-3.0.11-stable-bin.jar file to the
C:\jakarta-tomcat-5.0.27\common\lib and set up the JAVA SDK as per

BUT when I try and view http://localhost:8080/cocoon-test/sqlconnect in my
browser, all I get is an xml replication of the sqlextract.xml document and
when I check the Access Log file, there is a message as per the following:

INFO    (2004-06-18) 18:14.38:062   [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Reloading from:
INFO    (2004-06-18) 18:15.45:500   [access] (/cocoon-test/sqlconnect)
http-8080-Processor25/CocoonServlet: 'sqlconnect' Processed by Apache Cocoon
2.1.5 in 1.969 seconds.

The output is not what I was expecting, which should be a list of names - is
there a problem with the way I have set up the database connection? Do I
need to add a different serializer to view the output? I was under the
impression that the XML serializer would deliver the raw SQL data to the
browser. The SQL Query "select admin_name from wards" works from the MySQL

Any help will be greatly appreciated as I have no idea why this is



This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

Kensington & Chelsea PCT

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message