Class OracleDatabase
Class to represent an Oracle database.
Inherited Members
Namespace: DatabaseConnector
Assembly: DatabaseConnector.dll
Syntax
public class OracleDatabase : DatabaseObject
Constructors
| Improve this Doc View SourceOracleDatabase()
Initializes a new instance of the OracleDatabase class.
Declaration
public OracleDatabase()
OracleDatabase(ILogger)
Initializes a new instance of the OracleDatabase class.
Declaration
public OracleDatabase(ILogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Extensions.Logging.ILogger | logger | The logger to be used in this library. |
OracleDatabase(String)
Initializes a new instance of the OracleDatabase class.
Declaration
public OracleDatabase(string connectionString)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | connectionString | The connection string used to connnect to database. |
OracleDatabase(String, ILogger)
Initializes a new instance of the OracleDatabase class.
Declaration
public OracleDatabase(string connectionString, ILogger logger)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | connectionString | The connection string used to connnect to database. |
| Microsoft.Extensions.Logging.ILogger | logger | The logger to be used in this library. |
OracleDatabase(String, String, String, String, String)
Initializes a new instance of the OracleDatabase class.
Declaration
public OracleDatabase(string host, string port, string serviceName, string userID, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | host | Host name. |
| System.String | port | Port number. |
| System.String | serviceName | Service name. |
| System.String | userID | Username for login. |
| System.String | password | Password for login. |
Methods
| Improve this Doc View SourceConnect()
Connects to the database.
Declaration
public override bool Connect()
Returns
| Type | Description |
|---|---|
| System.Boolean | if the database has been successfully connected to.
|
Overrides
| Improve this Doc View SourceCreateCommandHelper(String, String, String, String, String, String)
Creates and returns the command line for executing SQL scripts.
Declaration
public static string CreateCommandHelper(string host, string port, string serviceName, string userID, string password, string filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | host | Host name. |
| System.String | port | Port number. |
| System.String | serviceName | Service name. |
| System.String | userID | Username for login. |
| System.String | password | Password for login. |
| System.String | filePath | File path of SQL script. |
Returns
| Type | Description |
|---|---|
| System.String | The command line for executing SQL scripts. |
CreateConnectionString(String, String, String, String, String)
Creates and returns the connection string.
Declaration
public static string CreateConnectionString(string host, string port, string serviceName, string userID, string password)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | host | Host name. |
| System.String | port | Port number. |
| System.String | serviceName | Service name. |
| System.String | userID | Username for login. |
| System.String | password | Password for login. |
Returns
| Type | Description |
|---|---|
| System.String | The connection string. |
Disconnect()
Disconnects from the database.
Declaration
public override bool Disconnect()
Returns
| Type | Description |
|---|---|
| System.Boolean | if the database has been successfully disconnected from.
|
Overrides
| Improve this Doc View SourceExecuteNonQuery(String)
Executes the given query that does not return any data (e.g. update, insert, delete).
Declaration
public override bool ExecuteNonQuery(string nonQuery)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | nonQuery | Query to execute. |
Returns
| Type | Description |
|---|---|
| System.Boolean | if query was successfully executed.
|
Overrides
| Improve this Doc View SourceExecuteQuery(String)
Executes the given query that retrieves data from the database.
Declaration
public override List<List<object>> ExecuteQuery(string query)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | query | Query to execute. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Collections.Generic.List<System.Object>> | Data queried from the database. |
Overrides
| Improve this Doc View SourceIsConnected()
Returns whether or not a connection has been established to the database.
if the database has been connected totrue
Declaration
public override bool IsConnected()
Returns
| Type | Description |
|---|---|
| System.Boolean | if the database has been connected to.
|