I'm using com.oracle.database.jdbc:ojdbc11:23.5.0.24.07
Create a table like this:
create table "_t" (i int primary key, j int);
create index "_i" on "_t" (j);
Now query JDBC's DatabaseMetaData
as follows:
connection.getMetaData().getColumns(null, "TEST", "_t", null);
connection.getMetaData().getPrimaryKeys(null, "TEST", "_t");
connection.getMetaData().getImportedKeys(null, "TEST", "_t");
connection.getMetaData().getExportedKeys(null, "TEST", "_t");
connection.getMetaData().getTablePrivileges(null, "TEST", "_t");
connection.getMetaData().getColumnPrivileges(null, "TEST", "_t", "%");
connection.getMetaData().getIndexInfo(null, "TEST", "_t", false, true);
All the methods work as expected except the getIndexInfo
one, which throws:
java.sql.SQLException: ORA-17068: Invalid arguments in call
https://docs.oracle.com/error-help/db/ora-17068/
at oracle.jdbc.OracleDatabaseMetaData.getIndexInfo(OracleDatabaseMetaData.java:3889)
at org.jooq.testscripts.JDBC.main(JDBC.java:54)
The workaround is to wrap the name in double quotes:
connection.getMetaData().getIndexInfo(null, "TEST", "\"_t\"", false, true);
But this doesn't seem necessary in my opinion. It's not necessary for any of the other queries, and the error message doesn't help understanding why this would be needed either.