Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Posts
    17

    Unanswered: how to know db is already created using java code

    Hi
    I am making using of java code, trying to find out whether some xxx database is already created or not, how to do this?
    can some select statement like in informix "select count(*) from sysdatabases where name='xxx'" is it possible in db2?

    -ravi

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    In order to submit an SQL statement you must first connect to a database, so that does not sound promising.

    But if you look at the recent thread in this forum called "Log File Pruning Script" there is a DB2 command that lists databases. The script may give you some ideas on how to parse the output.

    You could also just issue the DB2 connect command and parse the return code/output to see if it was succesful.

  3. #3
    Join Date
    Feb 2003
    Posts
    17
    got it, thanks.

    -ravi

    Originally posted by Marcus_A
    In order to submit an SQL statement you must first connect to a database, so that does not sound promising.

    But if you look at the recent thread in this forum called "Log File Pruning Script" there is a DB2 command that lists databases. The script may give you some ideas on how to parse the output.

    You could also just issue the DB2 connect command and parse the return code/output to see if it was succesful.

Posting Permissions

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