This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes tjdo tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic
Author

tjdo tables

nitinnitin sharma
Greenhorn

Joined: Sep 19, 2003
Posts: 3
hello everybody..
is it possible for me to check whether a particular table exist in a database or not through a program.
Thanks for helping me.
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
Look in tha API at DatabaseMetaData.getTables(). With the parameters set correctly, an null result set will mean the table does not exist. Conversely, a result set with at least one row would mean the table of interest exists.


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Yes, in databases like Oracle there are the dba_tables and user_tables view that you can query just like it was a regular table, and the field name table_name is in your where clause.
I am going to move this thread to JDBC. It seems more appropriate there.
Actually it appears that this is a duplicate post. Third time. So instead I am going to close this one, since there is already a duplicate of it in the JDBC forum.
Please refrain from duplicate posting in the future.
Thanks and welcome to JavaRanch.
Mark
[ September 19, 2003: Message edited by: Mark Spritzler ]

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tjdo tables
 
Similar Threads
Google India CodeJam
A Challenge!
13 Nov Riddle
How many Brits and Europeans on this board?
acronym atrocity