Brief introduction
In the view of. NET application developers, using DB2 is no different from using any other relational database. You can see countless examples of using SQL Server and Oracle products to perform database tasks, but for use include. NET, Microsoft technology access to DB2 database documents is far less than that.
Currently, developers can use different access technologies to programmatically. NET client is connected to the DB2, the code is fundamentally the same, but there are still some interesting limitations that we need to consider.
DB2 Architecture Overview
The basic elements of the DB2 database engine are database objects, system directories, directories, and configuration files, and all data access is done through the SQL interface. We can only run the DB2 univeral database (UDB) as a DB server, which requires no other product, but we need some other products for remote clients.
(Figure pict01)
The way we connect to DB2 determines the tasks we can accomplish. There are three kinds of technologies that can be used from. NET connection to DB2:
1. Use OLE DB. NET Managed Provider. If you are running DB2 V7 or lower versions and COM objects are callers, Microsoft and IBM two companies recommend using OLE DB data providers to access most DB2 data. In the. NET framework, OLE DB providers are represented through COM interop and use the drivers that are available for ADO development.
2. Use ODBC. NET Managed Provider. This approach provides access to the local ODBC driver, and the same way that OLE DB. NET Data Provider provides access to local OLE DB providers. The ODBC. NET Data provider is an add-on component of the. NET Framework that can be used in conjunction with all compatible ODBC drivers.