DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old January 22nd, 2006, 09:56 AM
oferc oferc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 1 oferc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 33 sec
Reputation Power: 0
Connect to DB 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  
Old January 26th, 2006, 08:12 AM
dcaillouet's Avatar
dcaillouet dcaillouet is offline
Big Endian
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2001
Location: Fly-over country
Posts: 1,173 dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level)dcaillouet User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 16 h 29 m 5 sec
Reputation Power: 24
Yes. You can connect to a DB2 database without using ODBC. However, you do need to install the DB2 client tools (DB2 Connect/Runtime client) on the machine you're going to be running the program from. This will load all of the .dll/.lib files necessary to make the connection. You also have to setup a profile that defines the databases you want to connect to. If you're using a recent version of the client tools you can use the Client Configuration Assistant to do this.

Once you have your machine setup correctly for connectivity you should be able to go to a DB2 command prompt and connect to your database using a command like:

CONNECT TO database USER userid USING password

If this works, then your machine is setup correctly for CLI connectivity without ODBC. Take a look at the following article (click here)

Personnally, I use the commercial SQLAPI for all my DB2 CLI connectivity to a mainframe from both Windows and Linux (C++ Builder and g++). I like this tool because it allows me to connect to the five different databases I use on a regular basis with one common API.

Or you could connect to DB2 using an open-source template library like OTL.

I've also used the DB2 CLI Developer's Guide as an excellent reference for writing straight CLI calls (without any kind of OTL/SQLAPI wrapper) in C++. All the code examples are in MS VC++ but all the function calls are still the same regardless of your compiler.
Comments on this post
pabloj agrees:

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Connect to DB using CLI without ODBC


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway