After posting I thought my description may be a little vague...

(snip)

Any keywords for Google or code samples are more than welcome in my pursuit
to get this working...

I'll just supply some code snippets, they might give you new ideas.. (or not) 
:-P

One additional note: we decided to code pretty much all business logic in plain Java and connect to these classes from FlowScript. (that is really easy)

Tomcat 5.0 server.xml config snippets (I removed customer specific details):
  ...
  <GlobalNamingResources>
    <!-- 1. Define the global datasource (MYDS) -->
    <Resource name="jdbc/MYDS" auth="Container" scope="Shareable" 
type="javax.sql.DataSource"/>

(you can probably name as many as you like, but dynamically as in without restarting tomcat I don't know..)

    <!-- 2. Define the datasource config params -->
    <ResourceParams name="jdbc/MYDS">
      <parameter>
        <name>driverClassName</name>
        <value>oracle.jdbc.OracleDriver</value>
      </parameter>
      <parameter>
        <name>url</name>
        
<value>jdbc:oracle:thin:@myoracleserver:myoracleport:myoracledbname</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>myuser</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>mypassword</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>20</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>10</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>-1</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources>
  ...
  <Service name="Catalina">
    <Connector port="8080"/>
    <Engine name="Catalina" defaultHost="localhost">
      <Logger className="org.apache.catalina.logger.FileLogger"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" 
resourceName="UserDatabase"/>
      <Host name="localhost" appBase="webapps">

        <!-- 3. Define a resourcelink in the defaultcontext that links to the 
global datasource -->
        <DefaultContext>
          <ResourceLink name="jdbc/MYDS" global="jdbc/MYDS" 
type="javax.sql.DataSource"/>
        </DefaultContext>

<!-- 4. Optional. Define an extra context that points to the webapps folder in the project-development environment (for easy reloading) -->
        <Context path="/test_site" docBase="C:\Projects\cocoon\webapp"/>
      </Host>
    </Engine>
  </Service>
  ...

Cocoon's web.xml snippet:
  ...
  <resource-ref>
    <res-ref-name>jdbc/MYDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
  <env-entry>
    <env-entry-name>datasource.ref</env-entry-name>
    <env-entry-value>jdbc/MYDS</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
  </env-entry>
  <env-entry>
    <env-entry-name>database.sortingkey.default</env-entry-name>
    <env-entry-value>5-1;4-0;2-1</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
  </env-entry>
  ...

Java code that creates a DataSource by looking up a setting from web.xml:
        ...
        Context context = new InitialContext();
        Context env = (Context) context.lookup("java:comp/env");

        // lookup the datasource reference
        String dataSourceRef = (String) config.get(GPS_AS_DATASOURCE_REF);

        // get the datasource
        dataSource = (DataSource) env.lookup(dataSourceRef);
        ...

The java-classes are wrapped in a jar, dropped in the web-inf/lib/ directory of Cocoon and in FlowScript we do an importPackage("Package.our.package.path") and create and access objects from them just as you would create and access any other class in Flowscript.

So you see, this isn't really Cocoon-specific. Nor does it tell how to use the datasource from cocoon components. On the other hand. You could handle database connectivity solely in Flowscript and pass any data relevant to components to them through parameters and alike..

HTH,
Geert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]