C# Class Azavea.Open.DAO.SQLServer.SQLServerDescriptor

This class represents the info necessary to connect to a SQL Server database. TODO: Add support for SQL Server Spatial.
Inheritance: Azavea.Open.DAO.SQL.AbstractSqlConnectionDescriptor, ITransactionalConnectionDescriptor
Afficher le fichier Open project: azavea/net-dao-sqlserver Class Usage Examples

Méthodes publiques

Свойство Type Description
Database string
Password string
Server string
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.

ColumnAliasPrefix ( ) : string
ColumnAliasSuffix ( ) : string
CreateDataAccessLayer ( ) : IDaLayer
CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
CreateNewConnection ( ) : DbConnection
MakeBitwiseAndClause ( string columnName ) : SqlClauseWithValue
MakeConnectionString ( string server, string database, string user, string password ) : string

Assembles a 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.

MakeModulusClause ( string fieldName ) : SqlClauseWithValue
NeedAsForColumnAliases ( ) : bool
NeedToAliasColumns ( ) : bool
SQLServerDescriptor ( Config config, string component, ConnectionInfoDecryptionDelegate decryptionDelegate ) : System

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

SQLServerDescriptor ( string server, string database, string user, string password ) : System

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

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

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

ColumnAliasPrefix() public méthode

public ColumnAliasPrefix ( ) : string
Résultat string

ColumnAliasSuffix() public méthode

public ColumnAliasSuffix ( ) : string
Résultat string

CreateDataAccessLayer() public méthode

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

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 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 server, string database, string user, string password ) : string
server string Server name that is hosting the database
database string Database name on the server.
user string User name to use when accessing the db.
password string Password for above user.
Résultat string

MakeModulusClause() public méthode

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

NeedAsForColumnAliases() public méthode

public NeedAsForColumnAliases ( ) : bool
Résultat bool

NeedToAliasColumns() public méthode

public NeedToAliasColumns ( ) : bool
Résultat bool

SQLServerDescriptor() public méthode

This constructor reads all the appropriate values from a config file.
public SQLServerDescriptor ( 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

SQLServerDescriptor() public méthode

Constructor that lets you pass everything as parameters rather than requiring a config.
public SQLServerDescriptor ( string server, string database, string user, string password ) : System
server string Server name. May not be null.
database string Database name on that server. May not be null.
user string Database user name, may be null.
password string Password for the user. May be null.
Résultat System

SetParametersOnCommand() public méthode

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

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

Database public_oe property

The database name. May not be null.
public string Database
Résultat string

Password public_oe property

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

Server public_oe property

The server name. May not be null.
public string Server
Résultat string

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