Connection to a Basis Plus database

Basis Plus is a product of the OpenText corporation, http://www.opentext.com/.

This document explain the specific aspects of connecting Cocoon to a Basis Plus database.

Downloading the jdbc drivers

There's no public download, you have to buy the drivers from your friendly local OpenText reseller.

Copy the provided jar file(s) (currently basisjdbc.jar) to the WEB-INF/lib directory of your Cocoon installation.

Setting Web.xml

In the WEB-INF directory you will find the web.xml file. Open it and add the name of the Basis JDBC driver class to the load-class parameter, as in this example:

  <init-param>
    <param-name>load-class</param-name>
    <param-value>com.opentext.basis.jdbc.BasisDriver</param-value>
  </init-param>

Be careful, there must be only one init-param with param-name='load-class' in this file. It can however contain the name of several classes separated by whitespace, if you're using different databases or need to load other classes at server startup.

Setting cocoon.xconf

This file is also found in the WEB-INF directory. Search for the <datasources> element in this file and add into it the element shown below, adapted to your system's configuration:

 <jdbc logger="core.datasources.basisplus.myLoggingName" name="myDataSourceName">
      <pool-controller max="10" min="5"/>
      <dburl>jdbc:opentext:basis://dbUser:dbPassword@dbServer:2033/dbName</dburl>
      <user>dbUser</user>
      <password>dbPassword</password>
  </jdbc>

Setting sitemap.xmap

To use your new database connection specify its name in the appropriate parameter of the Generator or Transformer that you're using to access the database.

Here's an example using the SQLTransformer:

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

See SpecificDatabaseConnection for info on configuring other databases.

Something wrong?

Error messages will be logged if Cocoon is unable to load the JDBC classes or to connect to the database. See ExploringTheLogs if you need help.

Readers comments

  • No labels