Hi, You could use SQLExec to run generic SQL query:
SQLExec.query("SET ROLE browse_japan").execute(context); See docs [1] for additional details. [1] https://cayenne.apache.org/docs/4.1/cayenne-guide/#sqlselect-and-sqlexec On Wed, Apr 8, 2020 at 8:18 AM Biswajeet Basumatary <biswajeet.basumat...@gmail.com> wrote: > > Hi , > > How to execute the following statements in Cayenne. Trying to access Oracle > schema using different account having select permission. > > SET ROLE browse_japan; > ALTER SESSION SET CURRENT_SCHEMA = JAPAN; > > Regards, > basu > > > Note in JDBC I can execute the following it works > . > Connection connection = dataSource.getConnection(); > connection.createStatement().execute("SET ROLE browse_japan"); > connection.createStatement().execute("ALTER SESSION SET CURRENT_SCHEMA = > JAPAN"); -- Best regards, Nikita Timofeev