Skip to main content

ADO.NET Drivers

PPJ uses ADO.NET interfaces to isolate application code from provider details. Compatibility still depends on the provider's supported types and operations, the PPJ adapter, and the target runtime. A provider implementing ADO.NET interfaces is not by itself a guarantee that every SQL or Oracle-specific operation will work.

Microsoft's System.Data.OracleClient is a deprecated historical provider. For Oracle projects, use an ODP.NET provider supported by the installed PPJ release and confirm array binding and stored-procedure behavior. See Microsoft's OracleClient reference.

Various peculiarities in the specific ADO.NET driver can be configured in the sql.config file or set programmatically using the PPJ.Runtime.Sql.SqlProperties class.

info

Since the PPJ is driver independent and a minimally compliant ADO.NET driver can be implemented directly in .NET, it is possible to easily add fully custom drivers to an application.

Exposing ADO.NET objects​

The SalSqlHandle and SalSqlSessionHandle types expose their inner ADO.NET objects through few and simple properties.

You can access the internal ADO.NET objects using the following members exposed by SalSqlHandle:

ConnectionThe instance of System.Data.IDbConnection corresponding to the Sql Handle. When the multiple connection option is off (default) and for connections using the same user/password, multiple Sql Handle instances share the same IDbConnection object.
CommandThe instance of System.Data.IDbCommand corresponding to the statement that has been prepared or executed.
DataReaderThe instance of System.Data.IDataReader that is connected to the database and returns the result set generated by the last executed statement. It's null when ResultSet mode is on.
DataSetThe instance of System.Data.DataSet populated with the entire result set generated by the last executed statement. It's null when ResultSet mode is off.

You can access the internal ADO.NET objects using the following members exposed by SalSqlSessionHandle:

ConnectionThe instance of System.Data.IDbConnection corresponding to the Sql Session Handle.

Error Codes​

Error codes returned by the PPJ Framework are the original codes returned by the database to the ADO.NET layer. This is different from SQLWindows/Team Developer behavior, which adds a certain predefined constant to the error code returned by the database. I.e., if Oracle return 01017, Gupta changes it to 21017.

Ownership and Deployment​

The exposed Connection, Command, and reader objects belong to the PPJ handle's lifecycle. Do not dispose, replace, or execute them independently while PPJ is using them. A shared connection also means a transaction can affect more than one handle.

Deploy the provider and any native client dependencies with matching process architecture. Test on a machine without development tools. Compare errors by provider and operation rather than retaining Team Developer's numeric offsets blindly.