I want to configure a data source in Payara 5 using PostgresQL as the database. This is my code from web.xml:
<data-source>
<name>java:global/my_ds</name>
<class-name>org.postgresql.ds.PGSimpleDataSource</class-name>
<server-name>postgres.host.test</server-name>
<port-number>0</port-number>
<database-name>mydb</database-name>
<user>user</user>
<password>pwd</password>
</data-source>
This works fine. However I need to set the current schema on the data source. There is a method on PGSimpleDataSource to do so, so I could do that programmatically. However I'd like to configure the current schema along with the other options. To that end, I tried:
- Adding another child tag called
<current-schema>my-schema</current-schema>
to the<data-source>
tag. My IDE complained that this additional tag is not allowed. - Adding a property with names
current-schema
andcurrentSchema
to the<data-source>
tag. That was allowed, but had no effect.
So, now I'm looking for the way that actually works.