Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JDBC and the fly likes dynamically finding the tables in a database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "dynamically finding the tables in a database" Watch "dynamically finding the tables in a database" New topic
Author

dynamically finding the tables in a database

carox kaur
Ranch Hand

Joined: Mar 19, 2009
Posts: 52
I am trying to find out the tables presesnt in the database through java program. I have correctly configured the DSN but table name "emp" and "employee" present in the database are not coming in the output. Tables are made in MS access. I have tried with oracle also but no output is coming!!! Can anyone detect the error?




Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874




ResultSet rset=dmd.getTables(null,null,"e%", new String[]{"TABLES"});


is it TABLES or TABLE ?
carox kaur
Ranch Hand

Joined: Mar 19, 2009
Posts: 52
Thanks..I am now able to access data from MS Access but not from oracle...
In oracle there are two types of users:
1. Database Users
2. Internal Users

User "HR" is under "database user",I am able to access the tables made under this user. On doing,
prints all the table names in teh output.

But "SYSTEM" and many other user are under "internal user". I am not able to access any tables made under this user !!! Why is it so? and How can i access such tables. On doing,

gives no output.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamically finding the tables in a database
 
Similar Threads
Determining null resultset
how to connect to oracle db table through java program using unix shell script?
Stored procedures in JDBC?
BufferedWriter error
Need Code Review