SSQLE  1.0
Simple SQL Editor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SSQLE.OracleConnection Class Reference

Implementation of connection to Oracle database. More...

Inheritance diagram for SSQLE.OracleConnection:
SSQLE.IConnection

Public Member Functions

void Open ()
 Opens the connection to the underlaying database. More...
 
void Close ()
 Closes the connection to the underlaying database. More...
 
QueryResult ExecuteQuery (string query)
 Executes the query into underlaying database and retrieves the results. More...
 
void Dispose ()
 Disposes the resources not freed by GC by calling Close to underlaying database. More...
 

Static Public Member Functions

static OracleConnection NewConnection (string host, string port, string sid, string user, string pass)
 Factory method for creating new instance of OracleConnection. Does not open the connection yet. Subsequent call to Open is required, before executing queries. More...
 

Private Member Functions

 OracleConnection (string host, string port, string sid, string user, string pass)
 Constructs new connection with given arguments. Does not open the connection yet. Subsequent call to Open is required, before executing queries. More...
 

Static Private Member Functions

static string GetConnectionString (string host, string port, string sid, string user, string pass)
 Returns connection string to be used as parameter for connecting to underlaying Oracle database. More...
 

Private Attributes

OracleAccess.OracleConnection connection
 Underlaying connection. More...
 
readonly string host
 
readonly string port
 
readonly string sid
 
readonly string user
 
readonly string pass
 

Detailed Description

Implementation of connection to Oracle database.

This implementation uses native ODP.NET (Oracle Data Provider for .NET) from NuGet packages.

Constructor & Destructor Documentation

SSQLE.OracleConnection.OracleConnection ( string  host,
string  port,
string  sid,
string  user,
string  pass 
)
private

Constructs new connection with given arguments. Does not open the connection yet. Subsequent call to Open is required, before executing queries.

Parameters
hostHost.
portPort.
sidSID.
userUser.
passEncrypted password. See ICrypto.
See also
GetConnectionString

.

Member Function Documentation

void SSQLE.OracleConnection.Close ( )

Closes the connection to the underlaying database.

Implements SSQLE.IConnection.

void SSQLE.OracleConnection.Dispose ( )

Disposes the resources not freed by GC by calling Close to underlaying database.

QueryResult SSQLE.OracleConnection.ExecuteQuery ( string  query)

Executes the query into underlaying database and retrieves the results.

Parameters
querySingle query to be executed by the underlaying databse.
Returns
Result of the query into the database.

ODP.NET provider allows execution of only one query at any given time. That means, that ; character is invalid in the query.

One could improve the implementation by parsing the query and looking for single command to be passed to the database by skipping comments, string literals and looking for semi colon.

Implements SSQLE.IConnection.

static string SSQLE.OracleConnection.GetConnectionString ( string  host,
string  port,
string  sid,
string  user,
string  pass 
)
staticprivate

Returns connection string to be used as parameter for connecting to underlaying Oracle database.

Parameters
hostHost to connect to. Can be hostname, IPv4 or IPv6 address or machine name.
portPort to connect to.
sidSID to connect to.
userUser to be authenticated as.
passEncrypted password to use for authentication. See ICrypto.
Returns
Connection string for ODP.NET implementation.
static OracleConnection SSQLE.OracleConnection.NewConnection ( string  host,
string  port,
string  sid,
string  user,
string  pass 
)
static

Factory method for creating new instance of OracleConnection. Does not open the connection yet. Subsequent call to Open is required, before executing queries.

Parameters
hostHost.
portPort.
sidSID.
userUser.
passEncrypted password. See ICrypto.
Returns
New instance of OracleConnection, which is not opened yet.
void SSQLE.OracleConnection.Open ( )

Opens the connection to the underlaying database.

Implements SSQLE.IConnection.

Member Data Documentation

OracleAccess.OracleConnection SSQLE.OracleConnection.connection
private

Underlaying connection.

readonly string SSQLE.OracleConnection.host
private
readonly string SSQLE.OracleConnection.pass
private
readonly string SSQLE.OracleConnection.port
private
readonly string SSQLE.OracleConnection.sid
private
readonly string SSQLE.OracleConnection.user
private

The documentation for this class was generated from the following file: