Check out the DatabaseMetaData class.
Chris Walker
Brainbench MVP for ASP
http://www.brainbench.com
> -----Original Message-----
> From: Loni & Bharat Nagwani [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 25, 2000 7:31 AM
> To: [EMAIL PROTECTED]
> Subject: Re: enumerating tables names in a database
>
>
> You can write a stored procedure in the database which
> queries the meta data
> and
> returns all the tables in a array. For example in oracle you can use
> 'select table_name from all_tables' in your stored procedure.
>
> You could also use this directly from JDBC by connecting as
> admin user.
>
> ----- Original Message -----
> From: Shawn Zhu <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 24, 2000 7:15 PM
> Subject: enumerating tables names in a database
>
>
> > Hi all,
> > Do you know if there's a way to enumerate table names in
> a database?
> >
> > I figure, I can try the follwoing assuming an Connection
> (conn) object has
> > been successfully obtained.
> >
> > ========================================
> > String catalog=null,
> > schemaPattern=null,
> > tableNamePattern="%",
> > types=null;
> >
> > DatabaseMetaData dbMD = conn.getMetaData();
> > ResultSet rs = getTables(catalog,
> > schemaPattern,
> > tableNamePattern,
> > types);
> >
> > ==========================================
> >
> > Will the above work? If so, is there a better way to
> achieve the same
> goal?
> >
> >
> ==============================================================
> =============
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets