cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hussayn <hussayn.dabb...@saxess.com>
Subject Re: How to configure the cocoon-2.2 database block ?
Date Wed, 29 Oct 2008 11:32:56 GMT

Hi, all. 

>From your valuable input i have started a cookbook example as seen below. I
have described, how
to add the dependencies for the database block and the db-driver into the
pom.xml (see below)

Now i got followup questions:

1.) Do i still have to create a databases-drivers.properties file as
described in
 
     http://cocoon.apache.org/2.2/blocks/databases/1.0/1409_1_1.html

2.) Where do i declare the database connection string ?

     I have read about datasources, which have to be defined in cocoon.xconf
     But i doubt, this is correct for maven driven cocoon-2.2.
     I even cant find a cocoon.xconf in my block ...

3.) Once i have declared the database connection, how do i actually access
the
     database through cocoon ? I see the following actions been described in
the 
     database document mentioned above:

     * DatabaseAddAction
     * DatabaseAddAction
     * DatabaseAuthenticatorAction
     * DatabaseCookieAuthenticatorAction
     * DatabaseDeleteAction
     * DatabaseDeleteAction
     * DatabaseQueryAction
     * DatabaseSelectAction
     * DatabaseSelectAction
     * DatabaseUpdateAction
     * DatabaseUpdateAction
     * OraAddAction
     * OraUpdateAction

      Where can i find working examples how to use these actions from the
sitemap ?

Thanks for any follow up hint.

regards, hussayn

================================================================

This is the beginning of a database cookbook. I plan to put it into the
official cocoon
documentation when it is finished. If anyone could give me helpfull advices
or 
corrections, that would be really a great help for me ...)

================================================================
COOCOON COOKBOOK --- DATABASE
================================================================

Setting up a database driven application using the database-block

1.) Add a dependency entry for the database block to your pom file.
     Currently version 1.0.0 is used. The dependency entry is:


    <dependency>
      <groupId>org.apache.cocoon</groupId>
      <artifactId>cocoon-databases-impl</artifactId>
      <version>1.0.0</version>
    </dependency>


2.) Add a dependency entry for your Database driver to your pom file.
     For example, if you want to use MySQL, you can directly write:


    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.6</version>
    </dependency>


    NOTE: If you need to use another driver for another database, which is
not publically
    available from the internet, you always can install it into your local
maven repository
    and then add it as dependency simlar to the MySQL driver example above.
    Assume, you have developed your own "superdriver", or got a propriate
"superdriver" 
    from your database vendor. Then you can install it to your local maven
repository
    as follows:

    mvn install:install-file -Dfile=mySuperDriver.jar \
                                 -DgroupId=your.company
                                 -DartifactId=superdriver
                                 -Dversion=2.2.1
                                 -Dpackaging=jar

    Once, your driver is installed, you can declare the dependency entry in
your pom:

    <dependency>
      <groupId>your.company</groupId>
      <artifactId>superdriver</artifactId>
      <version>2.2.1</version>
    </dependency>

=========================================================
cookbook end (to be completed)
=========================================================
-- 
View this message in context: http://www.nabble.com/How-to-configure-the-cocoon-2.2-database-block---tp20211363p20225242.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message