Title: Using Sybase via JDBC with cocoon 2

Hello everybody,

Rather than a problem report, here's a sucess story for a change.  (I couldn't find a reference to cocoon + Sybase in the archive so hopefully this will be handy in future) :

Environment: Tomcat 4.0; Cocoon 2; Windows 2000, Sybase server 11.0.3.3 and 12.0.0.2; jConnect 5.2

Here's what I did to get cocoon 2 to talk to Sybase.

I've put the following in cocoon.xconf

 <datasources>
    <jdbc name="sybcon">
       <pool-controller min="2" max="10" />
          <dburl>jdbc:sybase:Tds:128.0.0.18:2225/prod_talis</dburl>
          <user>username</user>
       <password>apassword</password>
    </jdbc>
  </datasources>

... the following in my sitemap.xconf

   <map:match pattern="sybsql/*">
    <map:generate src=""docs/samples/sql/{1}.xml"/>
    <map:transform type="sql">
      <map:parameter name="use-connection" value="sybcon"/>
        <!--
           Let's have a look at the user docs: 
           "[...] The purpose of the SQLTransformer is to query a
        database and translate the result to XML. [...]"
        -->
    </map:transform>
    <map:transform src=""stylesheets/simple-sql2html.xsl"/>
    <map:serialize/>
   </map:match>

... and the folllowing in my web.xml ...

    <init-param>
      <param-name>load-class</param-name>
      <param-value>
        com.sybase.jdbc2.jdbc.SybDriver
      </param-value>
    </init-param>

Even though jconn2.jar was on my classpath when I started tomcat, for some reason the cocoon.log showed that the class wasn't getting loaded.  My remedy for this was to put a copy of jconn2.jar into C:\Program files\Apache Tomcat 4.0\webapps\cocoon\WEB-INF\lib

After that - once I'd created my query page it was plain sailing.

Hope this helps,

Jon


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
_____________________________________________________________________
Any views or personal opinions expressed within this email may not be those of Talis Information Ltd.
The content of this email message and any files that may be attached are confidential, and for the usage of the intended recipient only. If you are not the intended recipient, then please return this message to the sender and delete it. Any use of this e-mail by an unauthorised recipient is prohibited.

Reply via email to