If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > connect to DB2 using CLI without ODBC

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-06, 11:02
oferc oferc is offline
Registered User
 
Join Date: Jan 2006
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 01-22-06, 16:12
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #3 (permalink)  
Old 01-23-06, 03:16
oferc oferc is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 01-23-06, 12:30
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534

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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On