Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007
    Posts
    130

    Unanswered: some dummy quesitons on DB2

    Hi All,


    I am totally new to DB2. I am sorry to disturbing you all with the following dummy questions

    I wonder
    (1) how to show all databases which have been created;
    (2) how to show all tables given a database;
    (3) please show me or recommend some code snippets on how to connect db2 database from JAVA applications.


    Thanks

  2. #2
    Join Date
    Oct 2010
    Posts
    19
    Hello. I am not clever with a java, but i try to help you.

    (1) how to show all databases which have been created;
    Using db2api. Or some analog in java, i guess.

    (2) how to show all tables given a database;

    Connect to database and run:
    select NAME, CREATOR from sysibm.systables
    Remeber, this script shows you system tables too.

    (3) please show me or recommend some code snippets on how to connect db2 database from JAVA applications.
    Basic steps

  3. #3
    Join Date
    Jul 2009
    Posts
    150

    Arrow

    If you don't want watch the system table names, use the query:

    Code:
    select tb.* 
    from sysibm.systables tb
    where NOT 
    tb.name like 'SYSIBM.%'
    Kara

  4. #4
    Join Date
    Apr 2007
    Posts
    130
    Thanks for your reply and help

    Actually , I want to know whether there are command line commands at the 'db2' prompt to show all already created databases on a DB2 server

  5. #5
    Join Date
    Oct 2010
    Posts
    19
    Quote Originally Posted by cy163 View Post
    Thanks for your reply and help

    Actually , I want to know whether there are command line commands at the 'db2' prompt to show all already created databases on a DB2 server
    You can use:

    LIST DB DIRECTORY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •