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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

Marco R.
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.