C# Class Azavea.Open.DAO.OleDb.OleDbDescriptor

This class represents the info necessary to connect to an OleDb data source.
Inheritance: Azavea.Open.DAO.SQL.AbstractSqlConnectionDescriptor, ITransactionalConnectionDescriptor
Afficher le fichier Open project: azavea/net-dao-oledb Class Usage Examples

Méthodes publiques

Свойство Type Description
ConnectTimeout int?
Database string
Password string
Provider string
Server string
Type DatabaseType
User string

Protected Properties

Свойство Type Description
_cleanConnStr string
_connectionStr string

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
GetTypeFromConfig ( Config config, string component ) : DatabaseType

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

Method Details

BeginTransaction() public méthode

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
Résultat ITransaction

CanUseAliasInOrderClause() public méthode

public CanUseAliasInOrderClause ( ) : bool
Résultat bool

CaseInsensitiveLikeOperator() public méthode

public CaseInsensitiveLikeOperator ( ) : string
Résultat string

ColumnAliasPrefix() public méthode

public ColumnAliasPrefix ( ) : string
Résultat string

ColumnAliasSuffix() public méthode

public ColumnAliasSuffix ( ) : string
Résultat string

CreateDataAccessLayer() public méthode

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
Résultat IDaLayer

CreateNewAdapter() public méthode

public CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
cmd IDbCommand
Résultat System.Data.Common.DbDataAdapter

CreateNewConnection() public méthode

public CreateNewConnection ( ) : DbConnection
Résultat System.Data.Common.DbConnection

FullOuterJoinKeyword() public méthode

public FullOuterJoinKeyword ( ) : string
Résultat string

GuessTypeFromProvider() public static méthode

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.
Résultat DatabaseType

HasCaseInsensitiveLikeOperator() public méthode

public HasCaseInsensitiveLikeOperator ( ) : bool
Résultat bool

LowerCaseFunction() public méthode

public LowerCaseFunction ( ) : string
Résultat string

MakeBitwiseAndClause() public méthode

public MakeBitwiseAndClause ( string columnName ) : SqlClauseWithValue
columnName string
Résultat Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeConnectionString() public static méthode

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.
Résultat string

MakeConnectionString() public static méthode

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.
Résultat string

MakeCreateIndexCommand() public méthode

public MakeCreateIndexCommand ( string indexName, bool isUnique, string tableName, IEnumerable columnNames ) : string
indexName string
isUnique bool
tableName string
columnNames IEnumerable
Résultat string

MakeModulusClause() public méthode

public MakeModulusClause ( string fieldName ) : SqlClauseWithValue
fieldName string
Résultat Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeSequenceValueQuery() public méthode

public MakeSequenceValueQuery ( string sequenceName ) : string
sequenceName string
Résultat string

NeedAsForColumnAliases() public méthode

public NeedAsForColumnAliases ( ) : bool
Résultat bool

NeedToAliasColumns() public méthode

public NeedToAliasColumns ( ) : bool
Résultat bool

OleDbDescriptor() public méthode

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.
Résultat System

OleDbDescriptor() public méthode

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.
Résultat System

OleDbDescriptor() public méthode

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.
Résultat System

OleDbDescriptor() public méthode

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.
Résultat System

SetParametersOnCommand() public méthode

public SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
cmd IDbCommand
parameters IEnumerable
Résultat void

SupportsTruncate() public méthode

public SupportsTruncate ( ) : bool
Résultat bool

TableAliasPrefix() public méthode

public TableAliasPrefix ( ) : string
Résultat string

TableAliasSuffix() public méthode

public TableAliasSuffix ( ) : string
Résultat string

ToCleanString() public méthode

public ToCleanString ( ) : string
Résultat string

ToCompleteString() public méthode

public ToCompleteString ( ) : string
Résultat string

UsePooling() public méthode

public UsePooling ( ) : bool
Résultat bool

Property Details

ConnectTimeout public_oe property

The connection timeout, in seconds. May be null, meaning use the default.
public int? ConnectTimeout
Résultat int?

Database public_oe property

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
Résultat string

Password public_oe property

The password for the User. May be null.
public string Password
Résultat string

Provider public_oe property

The "Provider", meaning the value for the provider field in the OleDB connection string.
public string Provider
Résultat string

Server public_oe property

The server name, meaningful for some databases (Oracle, SQL Server) but not others (Access). May be null depending on the database.
public string Server
Résultat string

Type public_oe property

The type of database (Oracle, SQL Server, etc).
public DatabaseType Type
Résultat DatabaseType

User public_oe property

The user name, if necessary to log into the database. May be null.
public string User
Résultat string

_cleanConnStr protected_oe property

protected string _cleanConnStr
Résultat string

_connectionStr protected_oe property

protected string _connectionStr
Résultat string