You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by tore Storødegård <to...@abnett.no> on 2000/03/26 15:07:50 UTC

sql processor and mysql????

Can anyone help me to get sql processor and mysql working

Accessing the database works perfect from a servlet, but when I try using
the cocoon sql processor, the response is not the same as the content in the
database. Accessing the database, and transforming to xml and then to html
works fine, but the content is not correct. Below you see an example of two
fields from two rows in the database.

Title 		AuthorName
[B@aa0df611 	[B@9689f611
[B@ac21f611 	[B@ac2df611

I am using:
Linux Redhat 6.1
MySql 3.22.22
MM Mysql jdbc drivers 1.2c
jdk 1.2.2 (Sun)

This is my xml file:

<?xml version="1.0"?>


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

<page>

 <connectiondefs>
  <connection name="myDB_connection">
   <driver>org.gjt.mm.mysql.Driver</driver>
   <dburl>jdbc:mysql://mydomain/myDB</dburl>
   <username>myuser</username>
   <password>mypasswd</password>
  </connection>
 </connectiondefs>

 <query connection="myDB_connection">
  select Title, AuthorName from news order by Title
 </query>

</page>

Any ideas?????


Re: sql processor and mysql????

Posted by Rob Parker <ro...@webcybernetics.com>.
Looks alot like a similar problem I experienced. I'd guess your fields are
of
type 'text'. You need to convert them into strings. You can do this by using
the 'substring' function. Your query will then look like select
substring(Title,1) ...

See earlier posts in the archives on the same topic for more info..

>
> Title AuthorName
> [B@aa0df611 [B@9689f611
> [B@ac21f611 [B@ac2df611
>