Objective:
Connect to an Oracle database using Oracle Data Provider for .NET (ODP.NET) and control parameters that manage ODP.NET database connection pooling.
Prerequisite:
I assume you are familiar with Microsoft Visual Studio .NET, and also have an basic understanding of ODP.NET and databases.
Introduction:
ODP.NET, which is included in the Oracle.DataAccesss.dll assembly, provides a robust collection of classes that assist in easy database interaction. It uses Oracle's native APIs to offer fast and reliable access to Oracle data and features from any .NET application.
In this tutorial, I will discuss how to use the OracleConnection class, provided by ODP.NET, then to establish a connection to an Oracle database and interact with the database. I will also show the usage of a small code fragment that demonstrates how to connect to an Oracle database using ODP.NET.
Connection pooling is enabled by default in ODP.NET. I will also explain how you can control the connection pooling parameters provided by ODP.NET.
Requirements:
Description:
When you install ODP.NET, the Oracle Universal Installer automatically registers ODP.NET with the Global Assembly Cache (GAC).
The most important class with respect to this tutorial is the OracleConnection class. An OracleConnection object represents a connection to an Oracle database. In this tutorial, I will display how to connect to an Oracle database and list names of all the employees and their employee number present in a table.
Now that I have discussed the objective, prerequisite, introduction, requirements, and description it is time to move on to the code.