Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    2

    Unanswered: get instance name using jdbc connection

    Hi All,
    I am new to DB2 database server. Here i perform jdbc connection with the following statement.

    jdbc:db2://"+hostName+":"+port+"/"+dbName+"";

    Here i would like to know the instance name of the dbname of a remote machine for which the connection is established. Is it possible to get instance name using sql statement rather than viewing /etc/services.

    Any help would be appreciated.

    Thanks,
    ramm

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You care to tell us which version of DB2 you are using on which platform?

    I'm asking because your question is completely irrelevant for DB2 z/OS, where you do not have an "instance" in the first place.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Select Inst_name From Table(sysproc.env_get_inst_info()) As Instanceinfo
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  4. #4
    Join Date
    May 2008
    Posts
    2
    Thank you for your response.
    Dear Stolze,
    I am using DB2 version 8.1 and 8.2 in LINUX and WINDOWS platform. I need to get the instance name of a dbname for the DB2 server through a jdbc connection with the db name, port and hostname information.
    Hope i am clear.

    Dear marcus,

    Thank you for your quick reply. I tries with the following statement to get the instance name of the DatabaseName.

    SELECT * FROM table(SYSPROC.HEALTH_DBM_INFO(-2)) DATABASEMANAGER

    Is the above statement right to get the instance name. Could you please let me know the difference between the following statements.

    Select Inst_name From Table(sysproc.env_get_inst_info()) As Instanceinfo
    SELECT * FROM table(SYSPROC.HEALTH_DBM_INFO(-2)) DATABASEMANAGER

    Will the above statement gives the instance name for any DB2 version.

    Also i would like to know more information regarding system tables of DB2 Database server. Could anyone please provide me any documentation or links to know more about system tables.

    Any help would be appreciated.

    Thanks,
    Ramm

Posting Permissions

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