cancel
Showing results for 
Search instead for 
Did you mean: 

how to have two, three or N datasources

geekonspace
Star Contributor
Star Contributor

I need get data from another database, how Can I do

1 ACCEPTED ANSWER

Julien_Carsique
Elite Collaborator
Elite Collaborator

Since Nuxeo 5.5, all datasource have effectively been merged into one common datasource. For instance, templates/common/config/default-sql-directories-bundle.xml is using datasource jdbc/nxsqldirectory which is bound to the common jdbc/nuxeo.

The common DS is defined in templates/default/conf/server.xml:

<!-- Common datasource for all basic nuxeo datasources -->
<Resource name="${nuxeo.db.commonds}" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000" driverClassName="${nuxeo.db.driver}"
    url="${nuxeo.db.jdbc.url}" validationQuery="${nuxeo.db.validationQuery}"
    username="${nuxeo.db.user}" password="${nuxeo.db.password}" />

With nuxeo.db.commonds=jdbc/nuxeo (set in templates/default/nuxeo.defaults).

That common DS is referenced by other datasources in templates/default/conf/Catalina/localhost/nuxeo.xml.

You can still create custom datasources in a custom nuxeo.xml and reference them in your XML extension points.

If doing so, you should create a custom template for overriding nuxeo.xml.

View answer in original post

3 REPLIES 3

Florent_Guillau
World-Class Innovator
World-Class Innovator

Please read the Setup documentation.

Can you change your question to have something more explicit like that other user that will have the same question will look it. Thanks.

Julien_Carsique
Elite Collaborator
Elite Collaborator

Since Nuxeo 5.5, all datasource have effectively been merged into one common datasource. For instance, templates/common/config/default-sql-directories-bundle.xml is using datasource jdbc/nxsqldirectory which is bound to the common jdbc/nuxeo.

The common DS is defined in templates/default/conf/server.xml:

<!-- Common datasource for all basic nuxeo datasources -->
<Resource name="${nuxeo.db.commonds}" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000" driverClassName="${nuxeo.db.driver}"
    url="${nuxeo.db.jdbc.url}" validationQuery="${nuxeo.db.validationQuery}"
    username="${nuxeo.db.user}" password="${nuxeo.db.password}" />

With nuxeo.db.commonds=jdbc/nuxeo (set in templates/default/nuxeo.defaults).

That common DS is referenced by other datasources in templates/default/conf/Catalina/localhost/nuxeo.xml.

You can still create custom datasources in a custom nuxeo.xml and reference them in your XML extension points.

If doing so, you should create a custom template for overriding nuxeo.xml.