Next.jdbc: Setting current Oracle Schema for a Datasource?

I have managed to create a Connection and change the current schema by supplying an optional “opts” map to the get-connection function, however I’m struggling to do something similar when creating a Datasource. https://github.com/seancorfield/next-jdbc/blob/develop/doc/all-the-options.md says:

“If you need additional options set on a connection, you can either use Java interop to set them directly, or provide them as part of the “db spec” hash map passed to get-datasource (although then they will apply to all connections obtained from that datasource).”

I’ve tried adding :connection {:schema "SCHEMA_NAME"} to the “db-spec” map which is passed to get-datasource without success, the current schema isn’t changed.

If schema=... is meant to be part of the connection string, just :schema "..." in the db-spec is what you want. You don’t want a :connection key.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.