Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    2

    Unanswered: connect to DB2 using CLI without ODBC

    Hi all,

    I wonder,

    Is it possibe to connect to the DB server, using the CLI API without setting and configuring before the ODBC setting with the DB2 data source? or in other words how do i configure the CLI client to use the CLI driver instead of the microsoft ODBC driver ? and can i connect to the DB using the DB name and not the ODBC fata source name ?

    Thanks in advance

    Ofer

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Many of your DB2 client tools (eg db2 command line) use CLI to communicate directly with the DB2 server.

    You will be able to write applications using CLI APIs directly .. Have a look at the CLI Guide and refernece that documents all the API and their usage ...

    BTW, the IBM DB2 ODBC driver 'translates' ODBC Compliant requests to DB2 CLI requests. In other words, when using ODBC you are in turn using the CLI library.
    IF you can be more specific about your requirement, someone may be able to guide you

    HTH

    Sathyaram


    Quote Originally Posted by oferc
    Hi all,

    I wonder,

    Is it possibe to connect to the DB server, using the CLI API without setting and configuring before the ODBC setting with the DB2 data source? or in other words how do i configure the CLI client to use the CLI driver instead of the microsoft ODBC driver ? and can i connect to the DB using the DB name and not the ODBC fata source name ?

    Thanks in advance

    Ofer
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2006
    Posts
    2
    Hi Sathyaram,

    I looked at the CLI guide before posting this question, from the CLI in order to build CLI client environment i must register my DB as ODBC data source and using the CLI connect functions i must give the DB data source name and not my DB name. however as u wrote the db2 command line succeed to connect without doing that , my question how to connect using DB name without defining ODBC data source ?

    Quote Originally Posted by sathyaram_s
    Many of your DB2 client tools (eg db2 command line) use CLI to communicate directly with the DB2 server.

    You will be able to write applications using CLI APIs directly .. Have a look at the CLI Guide and refernece that documents all the API and their usage ...

    BTW, the IBM DB2 ODBC driver 'translates' ODBC Compliant requests to DB2 CLI requests. In other words, when using ODBC you are in turn using the CLI library.
    IF you can be more specific about your requirement, someone may be able to guide you

    HTH

    Sathyaram

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    I guess you wnat a CLI appl to connect to the db without any client dependency ,
    like JDBC Type-3/Type-4 drivers.

    AFAIK, CLI does not provide support for this scenario.

    BTW, you do NOT need to define the database as a ODBC datasource, though you need to catalog the database at the client.


    HTH

    Sathyaram

    Quote Originally Posted by oferc
    Hi Sathyaram,

    I looked at the CLI guide before posting this question, from the CLI in order to build CLI client environment i must register my DB as ODBC data source and using the CLI connect functions i must give the DB data source name and not my DB name. however as u wrote the db2 command line succeed to connect without doing that , my question how to connect using DB name without defining ODBC data source ?
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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