DB2 UDB PE Version 8.1 & Linux

DB2 UDB PE Version 8.1 & Linux

Post by Berni » Thu, 17 Apr 2003 10:51:53



We need to access DB2 UDB PE Version 8.1 from a Linux (Mandrake 9.1) C++
app. What method will give us the best integration with Qt 3.x (plugin or
ODBC)?

There is sample code under /opt/IBM/db2/V8.1/sample/cpp (dbconn.spC)? If
there isn't a better choice, how do we integrate it into our program?

thanks.

 
 
 

DB2 UDB PE Version 8.1 & Linux

Post by Ian D. Bjorhovd » Thu, 17 Apr 2003 12:31:11



> We need to access DB2 UDB PE Version 8.1 from a Linux (Mandrake 9.1) C++
> app. What method will give us the best integration with Qt 3.x (plugin or
> ODBC)?

> There is sample code under /opt/IBM/db2/V8.1/sample/cpp (dbconn.spC)? If
> there isn't a better choice, how do we integrate it into our program?

You can write your code with embedded SQL (which is bound into a database).
Embedded SQL uses packages in the database.  The example dbconn.sqC and the
other files in the directory you list show this.  Writing static SQL
requires that you let DB2 prepare your source files before compiling them
(db2 "prep dbconn.sqC").

You can also write CLI code, which allows you to use dynamic SQL only.
The CLI samples are in the sqllib/cli directory.  CLI is akin to OCI in
Oracle and similar to ODBC.

Of course you could also write ODBC, but then you'd need an ODBC driver
manager.

Check the documentation, the "Application Development Guide - Programming
Client Apps."  This covers all of this in a lot more detail.

Good luck,

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

DB2 UDB PE Version 8.1 & Linux

Post by Ami » Sat, 19 Apr 2003 07:30:47




> > We need to access DB2 UDB PE Version 8.1 from a Linux (Mandrake 9.1) C++
> > app. What method will give us the best integration with Qt 3.x (plugin or
> > ODBC)?

> > There is sample code under /opt/IBM/db2/V8.1/sample/cpp (dbconn.spC)? If
> > there isn't a better choice, how do we integrate it into our program?

> You can write your code with embedded SQL (which is bound into a database).
> Embedded SQL uses packages in the database.  The example dbconn.sqC and the
> other files in the directory you list show this.  Writing static SQL
> requires that you let DB2 prepare your source files before compiling them
> (db2 "prep dbconn.sqC").

> You can also write CLI code, which allows you to use dynamic SQL only.
> The CLI samples are in the sqllib/cli directory.  CLI is akin to OCI in
> Oracle and similar to ODBC.

> Of course you could also write ODBC, but then you'd need an ODBC driver
> manager.

> Check the documentation, the "Application Development Guide - Programming
> Client Apps."  This covers all of this in a lot more detail.

> Good luck,

> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

You can use unixODBC as the driver manager. However if you want to
write using ODBC you can directly link to DB2 libraries without a
driver manager (might require some expertise).

Further there are third party libraries that can provide a lot of
flexibility and power. Take a look at RogueWave's SourcePro DB
library: http://www.roguewave.com/products/sourcepro/db/

Amit
Development Engineer
[Disclaimer: All views expressed here are my personal views and they
can be incorrect at times]