Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

SQL doubt  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we get the list of table names in a particular database(MS Access)? ie; I need a query which is similar to select * from dual; which works in Oracle
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to get a slist of table names back to Java this is how it can be done
//open connection to database
con = DriverManager.getConnection(url, userName, password);
//get db meta data
DatabaseMetaData db = con.getMetaData();
//get ResultSet of table names
ResultSet tablesDbMetaData = db.getTables(null,dsn,"%",types);
//loop through result set and get print table names
while(tablesDbMetaData.next())
{
tableName = tablesDbMetaData.getString("TABLE_NAME");
System.out.println("tableName = "+tableName);
}
 
whippersnapper
Ranch Hand
Posts: 1843
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
donepudi,
Please adjust your displayed name to meet the JavaRanch Naming Policy. You can do so here.
 
Michael Matola
whippersnapper
Ranch Hand
Posts: 1843
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by donepudi:
Can we get the list of table names in a particular database(MS Access)? ie; I need a query which is similar to select * from dual; which works in Oracle


select * from dual
gives you a list of table names in Oracle?
 
donepudi madhu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Matola:

select * from dual
gives you a list of table names in Oracle?


Sorry sir, it was told by my friend when I posed this query.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!