Use quoted schema in an insert statement executed thorough PreparedStatement in Java I created an unquoted table my_table under a quoted schema "Quoted_User". 

When executing the statement

INSERT INTO "Quoted_User".my_table (custom_id) VALUES (DEFAULT)


using the Intellij Oracle browser it works, but when I'm performing the same statement through a PreparedStatement in Java Oracle is complaining that the schema is not existing. Here's the prepared statement Java line:

statement = connection.prepareStatement(insertSQL, new String[]{custom_id});


and here is insertSQL as shown in the inspector:

INSERT INTO \"Quoted_User\".my_table (custom_id) VALUES (DEFAULT) 


It's like Oracle is removing the quotes, and I can say this because I noticed the uppercase letters in the error message which are always returned when the object is considered to be case insensitive.

Error returned by Oracle:

java.sql.SQLSyntaxErrorException: ORA-04043: object "QUOTED_USER" does not exist


There should be a way to use quoted schema names with prepared statements I guess.

Thanks for your hints, 

Mattia
Are you connecting to the database using the credentials of "Quoted_User"? In this case I see no reason to specify the schema name in your SQL statements. On the contrary, do you have the required privileges on the "Quoted_User" schema?

By the way, using mixed case identifiers is really NOT a good idea.