You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by "Marco R." <xo...@yahoo.it.INVALID> on 2018/05/28 15:38:54 UTC

[dbcp2] BasicDataSource datasource multiple schema PostgreSql instance and spring integration

Hello,I'm using PostgreSql in a Spring Integration web application, but the framework isn't finding my stored procedures because it tries to resolve their names against the 'public' schema, instead of the right one.
I'm not sure where the problem is located, so I am here asking for the DBCP2 side.

This is my PG server:
<instance>|`-- databases    |
    `-- "postgres"        |        `-- schemas            |            `-- "information_schema"            `-- "pg_catalog"            `-- "public"            `-- "target" *

*: This is the schema backing the application.
Questions:
1) Is BasicDataSource the right class to support a PostgreSql instance with multiple schemas, where the application schema is not the default (i.e. 'public') one?
2) Is the following Spring configuration complete to support my scenario or am I missing something?
<bean id="dbDataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" >
    <property name="driverClassName" value="org.postgresql.Driver"/>
    <property name="url" value="jdbc:postgresql://localhost:5432/postgres?currentSchema=target"/>
    <property name="username" value="postgres"/>
    <property name="password" value="root"/>
    <property name="defaultCatalog" value="postgres" />    
</bean>


RegardsMarco R.