Fundamental ODP.NET Classes to Retrieve Data
To retrieve data from an Oracle database using ODP.NET, we need to work with a
few of the ODP.NET classes. At this point, we will discuss the most fundamental
classes available in ODP.NET for retrieving data.
The following is the list of fundamental ODP.NET classes:
The OracleConnection class provides the means to connect to the Oracle database.
We have already used this class several number of times in the previous
chapter. It connects to Oracle database and performs all the operations we need
to carry out. Without this class, we would never be able to perform any
database operation. It also manages transactions and connection pooling.
The OracleCommand class is mainly used to execute commands against Oracle
database. It supports the execution of SQL commands (like SELECT, INSERT, and
CREATE), stored procedures, etc. We can even specify table or view names
(without even providing a SELECT statement) to retrieve the rows available
through them. It works in conjunction with OracleConnection to connect to
Book Excerpt: Retrieving Data from Oracle
This excerpt from
ODP.NET Developer's Guide: Oracle Database 10g Development with Visual Studio
2005 and the Oracle Data Provider for .NET by Jagadish Chatarji
Pulakhandam, Sunitha Paruchuri, is printed with permission from
Packt Publishing, Copyright 2007.