cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Blasl <>
Subject Get values from Postgres database
Date Thu, 12 Jun 2003 18:05:59 GMT

i want to set up an application with a postgres database.
It's my first contact with cocoon so far, maybe someone can help.
What I did so far:
Installed  Postgres, Apache, Tomcat and Cocoon.
Everything is working fine, and I also played a little bit with the 
cocoon features.

Now I  downloaded the JDBC-Driver for Postgres and put it into cocoons 
lib dir.
then edited web.xml:

       <!-- For IBM WebSphere: -->

       <!-- For Database Driver: -->
       <!-- For parent ComponentManager sample:

And I also edited cocoon.xconf:

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

If i put there something other then test (my database) thn on tty0 comes 
up DATABASE ... not found. So I guess that everything is set up ok so far.

Now I created a new directory under mount and put an xml-file in there:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
       select * from films
                  <sql:get-string column="code"/>
          <sql:get-string column="title"/>
                  <sql:get-date column="date_prod"
                     format="dd. MMM. yyyy"/>
                  <sql:get-date column="date_in"
                     format="dd. MMM. yyyy"/>
                  <sql:get-string column="kind"/>
            No records found...
            SQL Exception: <sql:get-message/>

I also have my own sitemap.xmap file in there:

<?xml version="1.0" encoding="iso-8859-1"?>
<map:sitemap xmlns:map="">

   <!-- use the standard components -->
       <map:generators default="file"/>
       <map:transformers default="xslt"/>
       <map:readers default="resource"/>
       <map:serializers default="html"/>
       <map:selectors default="browser"/>
       <map:matchers default="wildcard"/>
           <!-- respond to *.html requests with
                our docs processed by doc2html.xsl -->
           <map:match pattern="*.html">
               <map:generate src="{1}.xml"/>
               <map:transform src="doc2html.xsl"/>
               <map:serialize type="html"/>
         <map:match pattern="sql/*">

    <map:transform type="sql">
    <map:parameter name="use-connection" value="films"/>
    <map:transform src="stylesheets/simple-sql2html.xsl"/>

This is the table of my database:
             Table "public.films"
 Column   |          Type           | Modifiers
code      | character(5)            | not null
title     | character varying(40)   | not null
date_prod | date                    |
date_in   | date                    |
kind      | character(15)           |
len       | interval hour to minute |
Indexes: firstkey primary key btree (code)

When I now try to get the html-output of the xml file, all i get is this:

films select * from films No records found... SQL Exception:

Please, if anyone has an idea how to fix  it, I'd really be happy.

Thanks in advance,


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

View raw message