Search code examples
javaoracle-databaseresultsetdatabase-metadatasql-types

How to get all type names from a database using Java Swing?


I'd like to retrieve all trigger names from an oracle database schema.

I use getFunctions to retrieve all functions but i can't find another one for the types.

DatabaseMetaData dbmd;
ResultSet result = dbmd.getFunctions(null, Ousername, null);

Here is some created types :

create type FINAL_obj is object (acode integer,performance Float);
create type FINAL_tab is table of FINAL_obj;

Solution

  • You can do it using metadata.

    DatabaseMetaData dbmd = dbConnection.getMetaData(); 
    ResultSet result = dbmd.getTables("%", Ousername, "%", new String[]{ "TYPE" });
    while (result.next()) {
        result.getString("TABLE_NAME")
    }