You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mike Kelley <Mi...@M-V-T.COM> on 2001/12/19 06:04:19 UTC
Code request; Code to reveal a DB schema
I'm looking for some dynamic code that will reveal all libraries, files,
fields in a DB Does anyone have an example or can you point me in the right
direction?
I know I stumbled across something when installing TC but I can't find it
now ....
TIA
Mike
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: Code request; Code to reveal a DB schema
Posted by August Detlefsen <au...@yahoo.com>.
What DB are you using?
For Oracle, anyway:
SELECT table_name FROM all_tables;
SELECT trigger_name FROM all_triggers;
SELECT view_name FROM all_views;
...
-Will give you the lists of all tables, triggers, and views
respectively in your DB.
For the structure of each table, use:
DESC <tablename>
or
SELECT column_name, data_type
FROM user_tab_columns
WHERE table_name = '<tablename>';
You can also use DESC on the all_whatever views to see what other
columns are available for each one.
--- Mike Kelley <Mi...@M-V-T.COM> wrote:
> I'm looking for some dynamic code that will reveal all libraries,
> files,
> fields in a DB Does anyone have an example or can you point me in the
> right
> direction?
>
>
> I know I stumbled across something when installing TC but I can't
> find it
> now ....
>
> TIA
>
> Mike
>
> --
> To unsubscribe: <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>
Re: Code request; Code to reveal a DB schema
Posted by Jim Cheesman <jc...@msl.es>.
At 06:04 AM 19/12/01, you wrote:
>I'm looking for some dynamic code that will reveal all libraries, files,
>fields in a DB Does anyone have an example or can you point me in the right
>direction?
java.sql.DatabaseMetaData is your friend!
--
* Jim Cheesman *
Trabajo:
jchees@msl.es - (34)(91) 724 9200 x 2360
I'm still not sure
if I understand ambiguity.
--
To unsubscribe: <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>