OceanBase Connector/NET is a driver developed in C# for the .NET platform. It provides a connection to OceanBase Database and supports the following modes:
- Oracle mode: Supports Oracle-compatible APIs such as
OracleConnection,OracleCommand, andOracleDataReader. - MySQL mode: Uses the same approach as MySqlConnector, with the same connection method as MySQL Connector.
Cross-platform support
OceanBase Connector/NET is cross-platform and can run on Windows, Linux, and macOS. It allows enterprise applications to uniformly access OceanBase Database across various deployment environments.
Main modules and their support
This topic focuses on the Oracle mode. The MySQL mode uses the same approach as MySqlConnector, so it is not described here.
Module |
Supported features |
|---|---|
| OracleTransaction | Commit/CommitAsync, Rollback/RollbackAsync; named savepoints; isolation levels ReadCommitted, RepeatableRead, and Serializable (ReadUncommitted and Snapshot are not supported). |
| OracleCommand | CommandType.Text and CommandType.StoredProcedure; ExecuteNonQuery, ExecuteScalar, and ExecuteReader (including asynchronous); Prepare/PrepareAsync; OUT/InputOutput/ReturnValue parameters for stored procedures; REF CURSOR result sets; ArrayBinding for batch DML (UseArrayBinding=true and ArrayBindCount required); CommandTimeout, Cancel, and LastInsertedId. |
| OracleDataReader | Read/ReadAsync, NextResult/NextResultAsync; GetValue, GetString, GetInt16/32/64, and other methods; GetOracleBlob, GetOracleClob, and GetOracleTimeStamp for Oracle types; traversal of multiple result sets and REF CURSORs; RowId reading. |
| OracleConnection | Open/OpenAsync, Close/CloseAsync; BeginTransaction, CreateCommand, ChangeDatabase, and Ping; connection pooling, SSL; EnlistTransaction for distributed transactions. In Oracle mode, the Database (schema) must be specified. Current limitations: GetSchema is not supported; CreateBatch for batch processing is not supported. |
| OracleParameter | Named parameters (@name, :name); Direction: Input, Output, InputOutput, and ReturnValue; OracleDbType and DbType. |
| OracleDataSource | Create a data source and obtain a connection using OracleDataSource or OracleClientFactory.CreateDataSource(). |
| OracleCommandBuilder | Supports the DeriveParameters static method to automatically derive parameter information from a stored procedure. |
| OracleClientFactory | Implements DbProviderFactory and can create objects such as OracleConnection, OracleCommand, OracleCommandBuilder, and OracleDataSource. |
Unsupported scenarios
- GetSchema (calling this method on OracleConnection will throw a NotSupportedException)
- CreateBatch (batch processing)
- OracleDataAdapter
