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
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 *
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?
*Totally* DB specific. For Oracle try searching http://technet.oracle.com;
for anything else try asking on a database list? ;-)
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!
Wow! I didn't know that, ta!
Apols for the previous wrong answer then.
J.
--
, Interbase,
Cloudscape, Instant DB, Postgres,
MS SQL)
-Ursprüngliche Nachricht-
Von: Jim Cheesman [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 19. Dezember 2001 09:42
An: Tomcat Users List
Betreff: Re: Code request; Code to reveal a DB schema
At 06:04 AM 19/12/01, you wrote:
I'm
PROTECTED]
Sent: Wednesday, December 19, 2001 2:00 AM
Subject: AW: Code request; Code to reveal a DB schema
At least in some versions of sybase
DatabaseMetaData.getColumns() doesn't
work.
We use the following as a workaround:
select * from 'tablename' where 1 1
and use ResultSetMetaData to find
*Totally* DB specific. For Oracle try searching
http://technet.oracle.com;
for anything else try asking on a database list? ;-)
For code examples I would poke around Netbeans code they have some cool
functionality in Runtime tab of the explorer, i.e. database browser of some
kind. Try to
]]
Gesendet: Mittwoch, 19. Dezember 2001 15:11
An: Tomcat Users List
Betreff: Re: Code request; Code to reveal a DB schema
For sybase, it used to be that you have to run a SQL script
to load some
system procs before the MetaData stuff would work. Their
jConnect driver
used to document
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: mailto:[EMAIL