After I create VIEW, database engine pases my query and store it some how. Can One then discover what tables are utilized by one view? I realize that different databases might be in a different way. Might have some kind of degree of abstraction throw JDBC.

Something informs me that this is accomplished through getTables(?):

Connection con = DriverManager.getConnection(DBURL, DBUSER, DBPASS);        
DatabaseMetaData md = con.getMetaData();
md.getTables(null, null, null, null);

If it cannot be. Exist solution particularly for Oracle database (like view/referenses in plsql developer)?


Select * from dictionary 

Returns many system tables/functions you can get that have valuable structure information.

for the reason that list you will notice

Select * from ALL_Views (which consists of the origin SQL for that view) that could be parsed for table names.

Though I believe there's an exciting_Dependencies or all_References view which will contain needed references to tables in seperate fields which may be simpler to parse I am searching for that now...

Select * from All_dependencies WHERE Name = 'YOUR_VIEWNAME' and Referenced_Type='TABLE' will return all recommended tables.

Though I am unsure how individuals features use Linked tables. therefore if you are referencing exterior tables though a linked server... individuals features might not work.

EDIT: Nevermind, misinterpret the question: I figured you desired to retrieve the sights themselves.

So far as I understand there's no JDBC specific method to retrieve these details: you will have to dive to your database specific system tables and find out in the event that details are available.

Answer below identifies how you can retrieves view and doesn't answer the question:

DatabaseMetaData#getTables() with type "VIEW"


dmd.getTables(catalog, schema, "%", new String[] {"VIEW"});