cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: C2.2: Howto add a database as a datasource
Date Tue, 16 Oct 2007 19:57:26 GMT
Hanne Moa pisze:
> There is an example of how to add a database for 2.1.x at
> <>, and
> databases that supply jdbc-drivers also tell where you should put the
> .jar-file. For 2.2 there's the migration guide at
> <> but
> this doesn't mention where to put the jdbc-driver's jar-file when using
> something else than hsqldb.
> In 2.10 it could be put in WEB-INF/lib of the cocoon root, where should
> it go for 2.2?

I think that the best way is to create simple Maven module by following
cocoon-databases-hsqldb-client module as an example. In short this module should contain:
a) property file similar to the
src/main/resources/META-INF/cocoon/properties/ that
tell Cocoon to load jdbc driver
b) dependency on the driver of your choice, in pom.xml you can see:
You should search Maven repository for driver for your database and add necessary dependency
that's all. It will be added automatically to the classpath. If you need a driver that is
uploaded on Maven's repository you can install it by hand in your local Maven repository,
see [1].

Of course, you don't need to create separate module and you can put everything to the block
you are
developing. It's your choice if you want clear separation or not.

Last note: Instead of installing of jdbc driver you could just put it into WEB-INF/lib of
webapp module (created from webapp archetype). Be warned that I haven't tried this method
so I have
no idea if it's going to work.

> Oh, and there should be a guide for how to set up a database as a
> datasource besides the migration-guide too of course, unless no new
> users are wanted ;)

Certainly new users are wanted and I agree with you that some document for newbies is needed.
Anyway, it's always that someone has to write it. As you already gathering all needed knowledge
could you try to write such document? I (and others) would be very grateful!


Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon

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

View raw message