I am trying to alter the schema for the newly created JDBC connection with the following code:
Statement stmt = conn.createStatement();
String sql = "ALTER SESSION SET CURRENT_SCHEMA=abcd;";
stmt.execute(sql);
This code throws java.sql.SQLSyntaxErrorException: ORA-00922: missing or invalid option
If I try to run the ALTER SESSION SET CURRENT_SCHEMA="abcd";
command through Oracle SQL Developer it successfully alters the schema.
How can I alter the schema through Java?