dbTalk Databases Forums  

Getting MetaData for JDBC tables with getTables() does not work?

comp.databases.oracle comp.databases.oracle


Discuss Getting MetaData for JDBC tables with getTables() does not work? in the comp.databases.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Hansen
 
Posts: n/a

Default Getting MetaData for JDBC tables with getTables() does not work? - 01-26-2005 , 04:06 PM






When I access an Oracle database I can successfully select rows from a database
table. So at least one table must exist. But when I try to
access the MetaData with getTables() I get no data. Why?

I use the follwoing coding:

String dbname = "MYDB.TABLEA";
DatabaseMetaData md = cn.getMetaData();
ResultSet rsm = md.getTables(null, null, dbname, null);
if (rsm.next()) {
res = true;
System.out.println("tables found"); }
else
System.out.println("tables not found");

For what are the 4 parameters of getTables? I found some samples with
percentage signs as values. Others filled the last paramter and left the third
parameter to null. From my point of view putting null into parm 1 and 2
should return ALL tables for all users. Is this correct?


Thomas


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.