C# Класс Azavea.Open.DAO.OleDb.OleDbDescriptor

This class represents the info necessary to connect to an OleDb data source.
Наследование: Azavea.Open.DAO.SQL.AbstractSqlConnectionDescriptor, ITransactionalConnectionDescriptor
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ConnectTimeout int?
Database string
Password string
Provider string
Server string
Type DatabaseType
User string

Защищенные свойства (Protected)

Свойство Тип Описание
_cleanConnStr string
_connectionStr string

Открытые методы

Метод Описание
BeginTransaction ( ) : ITransaction

Begins the transaction. Returns a NEW ConnectionDescriptor that you should use for operations you wish to be part of the transaction. NOTE: You MUST call Commit or Rollback on the returned ITransaction when you are done.

CanUseAliasInOrderClause ( ) : bool
CaseInsensitiveLikeOperator ( ) : string
ColumnAliasPrefix ( ) : string
ColumnAliasSuffix ( ) : string
CreateDataAccessLayer ( ) : IDaLayer

Returns the appropriate data access layer for this connection. The default implementation returns a normal SQL data access layer, but this may be overridden in particular DB connection descriptors.

CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
CreateNewConnection ( ) : DbConnection
FullOuterJoinKeyword ( ) : string
GuessTypeFromProvider ( string provider ) : DatabaseType

Attempts to parse the provider string and determine what database type we're connecting to.

HasCaseInsensitiveLikeOperator ( ) : bool
LowerCaseFunction ( ) : string
MakeBitwiseAndClause ( string columnName ) : SqlClauseWithValue
MakeConnectionString ( DatabaseType providerType, string server, string database, string user, string password, int connectionTimeout ) : string

Assembles a OLEDB connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.

MakeConnectionString ( string provider, string server, string database, string user, string password, int connectionTimeout ) : string

Assembles a OLEDB connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.

MakeCreateIndexCommand ( string indexName, bool isUnique, string tableName, IEnumerable columnNames ) : string
MakeModulusClause ( string fieldName ) : SqlClauseWithValue
MakeSequenceValueQuery ( string sequenceName ) : string
NeedAsForColumnAliases ( ) : bool
NeedToAliasColumns ( ) : bool
OleDbDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System

This constructor reads all the appropriate values from a config file.

OleDbDescriptor ( DatabaseType type, string server, string database, string user, string password, int timeout ) : System

Constructor that lets you pass everything as parameters rather than requiring a config.

OleDbDescriptor ( DatabaseType type, string provider, string server, string database, string user, string password, int timeout ) : System

Constructor that lets you pass everything as parameters rather than requiring a config.

OleDbDescriptor ( string provider, string server, string database, string user, string password, int timeout ) : System

Constructor that lets you pass everything as parameters rather than requiring a config.

SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
SupportsTruncate ( ) : bool
TableAliasPrefix ( ) : string
TableAliasSuffix ( ) : string
ToCleanString ( ) : string
ToCompleteString ( ) : string
UsePooling ( ) : bool

Приватные методы

Метод Описание
GetTypeFromConfig ( Config config, string component ) : DatabaseType

Gets the type based on a couple optional parameters in the DB config file.

Описание методов

BeginTransaction() публичный Метод

Begins the transaction. Returns a NEW ConnectionDescriptor that you should use for operations you wish to be part of the transaction. NOTE: You MUST call Commit or Rollback on the returned ITransaction when you are done.
public BeginTransaction ( ) : ITransaction
Результат ITransaction

CanUseAliasInOrderClause() публичный Метод

public CanUseAliasInOrderClause ( ) : bool
Результат bool

CaseInsensitiveLikeOperator() публичный Метод

public CaseInsensitiveLikeOperator ( ) : string
Результат string

ColumnAliasPrefix() публичный Метод

public ColumnAliasPrefix ( ) : string
Результат string

ColumnAliasSuffix() публичный Метод

public ColumnAliasSuffix ( ) : string
Результат string

CreateDataAccessLayer() публичный Метод

Returns the appropriate data access layer for this connection. The default implementation returns a normal SQL data access layer, but this may be overridden in particular DB connection descriptors.
public CreateDataAccessLayer ( ) : IDaLayer
Результат IDaLayer

CreateNewAdapter() публичный Метод

public CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
cmd IDbCommand
Результат System.Data.Common.DbDataAdapter

CreateNewConnection() публичный Метод

public CreateNewConnection ( ) : DbConnection
Результат System.Data.Common.DbConnection

FullOuterJoinKeyword() публичный Метод

public FullOuterJoinKeyword ( ) : string
Результат string

GuessTypeFromProvider() публичный статический Метод

Attempts to parse the provider string and determine what database type we're connecting to.
public static GuessTypeFromProvider ( string provider ) : DatabaseType
provider string OleDB "provider" piece of the connection string.
Результат DatabaseType

HasCaseInsensitiveLikeOperator() публичный Метод

public HasCaseInsensitiveLikeOperator ( ) : bool
Результат bool

LowerCaseFunction() публичный Метод

public LowerCaseFunction ( ) : string
Результат string

MakeBitwiseAndClause() публичный Метод

public MakeBitwiseAndClause ( string columnName ) : SqlClauseWithValue
columnName string
Результат Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeConnectionString() публичный статический Метод

Assembles a OLEDB connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.
public static MakeConnectionString ( DatabaseType providerType, string server, string database, string user, string password, int connectionTimeout ) : string
providerType DatabaseType Database type, will be used to determine provider string.
server string Server name that is hosting the database
database string Database name, if necessary to specify
user string User name to use when accessing the db
password string Password for above user.
connectionTimeout int How long to wait before giving up on a command, in seconds.
Результат string

MakeConnectionString() публичный статический Метод

Assembles a OLEDB connection string that can be used to get a database connection. All the parameters are optional for the purposes of this method, although obviously it would be possible to create a useless connection string if you leave out important parameters.
public static MakeConnectionString ( string provider, string server, string database, string user, string password, int connectionTimeout ) : string
provider string Database driver/type/something, for example "SQLOLEDB"
server string Server name that is hosting the database
database string Database name, if necessary to specify
user string User name to use when accessing the db
password string Password for above user.
connectionTimeout int How long to wait before giving up on a command, in seconds.
Результат string

MakeCreateIndexCommand() публичный Метод

public MakeCreateIndexCommand ( string indexName, bool isUnique, string tableName, IEnumerable columnNames ) : string
indexName string
isUnique bool
tableName string
columnNames IEnumerable
Результат string

MakeModulusClause() публичный Метод

public MakeModulusClause ( string fieldName ) : SqlClauseWithValue
fieldName string
Результат Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeSequenceValueQuery() публичный Метод

public MakeSequenceValueQuery ( string sequenceName ) : string
sequenceName string
Результат string

NeedAsForColumnAliases() публичный Метод

public NeedAsForColumnAliases ( ) : bool
Результат bool

NeedToAliasColumns() публичный Метод

public NeedToAliasColumns ( ) : bool
Результат bool

OleDbDescriptor() публичный Метод

This constructor reads all the appropriate values from a config file.
public OleDbDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System
config Azavea.Open.Common.Config Config to get params from.
component string Section of the config XML to look in for db params.
decryptionDelegate ConnectionInfoDecryptionDelegate Delegate to call to decrypt password fields. /// May be null if passwords are in plain text.
Результат System

OleDbDescriptor() публичный Метод

Constructor that lets you pass everything as parameters rather than requiring a config.
public OleDbDescriptor ( DatabaseType type, string server, string database, string user, string password, int timeout ) : System
type DatabaseType Type of database to connect to. May not be null. This parameter /// will be used to determine what OleDb provider to use.
server string Server (or in the case of access, .mdb file) May be null, but you /// probably won't be able to connect to anything.
database string database name on that server, if applicable. May be null.
user string Database user name, may be null.
password string Password for the user. May be null.
timeout int Connection timeout, in seconds. May be null.
Результат System

OleDbDescriptor() публичный Метод

Constructor that lets you pass everything as parameters rather than requiring a config.
public OleDbDescriptor ( DatabaseType type, string provider, string server, string database, string user, string password, int timeout ) : System
type DatabaseType Type of database to connect to. May not be null. This parameter /// will be used to determine what OleDb provider to use.
provider string Database provider string. May be null. If null, we will use a /// provider value based on the type, if not null, we will use this /// provider.
server string Server (or in the case of access, .mdb file) May be null, but you /// probably won't be able to connect to anything.
database string database name on that server, if applicable. May be null.
user string Database user name, may be null.
password string Password for the user. May be null.
timeout int Connection timeout, in seconds. May be null.
Результат System

OleDbDescriptor() публичный Метод

Constructor that lets you pass everything as parameters rather than requiring a config.
public OleDbDescriptor ( string provider, string server, string database, string user, string password, int timeout ) : System
provider string Database provider string. May not be null.
server string Server (or in the case of access, .mdb file) May be null, but you /// probably won't be able to connect to anything.
database string database name on that server, if applicable. May be null.
user string Database user name, may be null.
password string Password for the user. May be null.
timeout int Connection timeout, in seconds. May be null.
Результат System

SetParametersOnCommand() публичный Метод

public SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
cmd IDbCommand
parameters IEnumerable
Результат void

SupportsTruncate() публичный Метод

public SupportsTruncate ( ) : bool
Результат bool

TableAliasPrefix() публичный Метод

public TableAliasPrefix ( ) : string
Результат string

TableAliasSuffix() публичный Метод

public TableAliasSuffix ( ) : string
Результат string

ToCleanString() публичный Метод

public ToCleanString ( ) : string
Результат string

ToCompleteString() публичный Метод

public ToCompleteString ( ) : string
Результат string

UsePooling() публичный Метод

public UsePooling ( ) : bool
Результат bool

Описание свойств

ConnectTimeout публичное свойство

The connection timeout, in seconds. May be null, meaning use the default.
public int? ConnectTimeout
Результат int?

Database публичное свойство

The database name, meaningful for some databases (Access (filename), SQL Server) but not others (Oracle). May be null depending on the database.
public string Database
Результат string

Password публичное свойство

The password for the User. May be null.
public string Password
Результат string

Provider публичное свойство

The "Provider", meaning the value for the provider field in the OleDB connection string.
public string Provider
Результат string

Server публичное свойство

The server name, meaningful for some databases (Oracle, SQL Server) but not others (Access). May be null depending on the database.
public string Server
Результат string

Type публичное свойство

The type of database (Oracle, SQL Server, etc).
public DatabaseType Type
Результат DatabaseType

User публичное свойство

The user name, if necessary to log into the database. May be null.
public string User
Результат string

_cleanConnStr защищенное свойство

protected string _cleanConnStr
Результат string

_connectionStr защищенное свойство

protected string _connectionStr
Результат string