.NET and DB2

  • Thread starter Thread starter Max Frecci
  • Start date Start date
M

Max Frecci

Hi,
I must develop a web application whose database is IBM DB2.
Can anyone give me some hints about OLE DB / ODBC .NET
Data Provider?
Which one I have o use? Is there a specific driver for DB2?
Thank you in advance,

Max
 
Hi

OLE DB, OleDbConnection (.NET) from ms

TCP/IP:
"Provider=DB2OLEDB;Network Transport
Library=TCPIP;Network Address=XXX.XXX.XXX.XXX;Initial
Catalog=MyCtlg;Package Collection=MyPkgCol;Default
Schema=Schema;User ID=MyUser;Password=MyPW"


APPC:
"Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC
Remote LU Alias=MyRemote;Initial Catalog=MyCtlg;Package
Collection=MyPkgCol;Default Schema=Schema;User
ID=MyUser;Password=MyPW"

HTH
Ravikanth[MVP]
 
Yes, you can get to DB2 from .NET.

There are two categories of connecting - fully managed providers, and
"legacy" providers (OLEDB and ODBC). Managed providers are providers
specifically written for .NET. They potentially deliver better performance,
but they are less mature. Currently there are fully managed providers for
Oracle and SQL Server, but none shipping yet for DB2, I think. Someone
please correct me if I am wrong. In the second category are the ADO.NET
providers for OLEDB and ODBC, for DB2.

Managed providers
There are at least 3 vendors currently building managed providers for DB2, :

----------------------
Microsoft
The DB2 managed provider is a feature of the forthcoming Host Integration
Server 2004.
Written in C#, sits directly on top of the new Microsoft DRDA AR (DB2
network client) and does not go through an intermediary code layer (ODBC).
Result: better performance.
There is no Visual Studio integration (designer support) at this time.
HIS2004 is currently in beta.
RTM is planned for 1st quarter, 2004.

----------------------
IBM
- currently in beta, I think.
- IBM has stated that they will offer their managed provider as a feature of
IBM DB2 Connect (probably in V8R2), and also DB2 UDB. If you are trying to
get to the mainframe, you want the former. DB2 Connect is available in a
number of licensing options: desktop only, server only (per server or per
processor), and enterprise-wide. I am not an IBM employee, so FWIW.

VS IDE integration is planned. This means you will be able to visually
explore the various DB2 resources, similar to what you can do with SQL
server today from within VS.
http://www7b.software.ibm.com/dmdd/downloads/dotnetbeta/
provider eval:
http://www6.software.ibm.com/dl/db2udbdl/db2udbdl-p
requires DB2 UDB v8.1 or DB2 Connect v8.1.2 (for mainframes, as400) or
better.

----------------------
DataDirect
http://www.ddtek.com/. I understand the db2 managed provider is under
development but have no further details.

----------------------
Mono
I have heard that the mono project is building a managed provider for DB2. I
have no details on this.


----------------------
In addition, there are other ways to get to DB2, from within ADO.NET:
-The ODBC provider, of course, that ships with DB2 since v5? Use
System.Data.Odbc .
-The MS OLEDB provider (aka DB2OLEDB) that ships with HIS 2000. Use
System.Data.OleDb .
-The IBM OLEDB provider (aka IBMDADB2) bundled with DB2 since v6. Use to DB2
v7.2 FP6 or later (current is FP9), you will get some improvements in the
data client. Use System.Data.OleDb .

All of these ways work, and work just fine. The tricky part is that there
is a matrix of features, like transactions, BLOBs, cursors, support for APPC
and SNA, and so on; which are not uniformly supported by all mechanisms.
Sorry I do not have the matrix. Check with the particular vendor for
feature support.

If some of you are thinking, what about the OLEDB provider for ODBC (shipped
by MS), coupled with the ODBC driver for DB2 (from IBM)? This works from
VB6, or script, but you cannot use the OLEDB provider for ODBC, within .NET.
 
Back
Top