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
Datei anzeigen Open project: azavea/net-dao-sqlserver Class Usage Examples

Public Properties

Property Type Description
Database string
Password string
Server string
User string

Protected Properties

Property Type Description
_cleanConnStr string
_connectionStr string

Public Methods

Method 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 method

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
return ITransaction

ColumnAliasPrefix() public method

public ColumnAliasPrefix ( ) : string
return string

ColumnAliasSuffix() public method

public ColumnAliasSuffix ( ) : string
return string

CreateDataAccessLayer() public method

public CreateDataAccessLayer ( ) : IDaLayer
return IDaLayer

CreateNewAdapter() public method

public CreateNewAdapter ( IDbCommand cmd ) : DbDataAdapter
cmd IDbCommand
return System.Data.Common.DbDataAdapter

CreateNewConnection() public method

public CreateNewConnection ( ) : DbConnection
return System.Data.Common.DbConnection

MakeBitwiseAndClause() public method

public MakeBitwiseAndClause ( string columnName ) : SqlClauseWithValue
columnName string
return Azavea.Open.DAO.SQL.SqlClauseWithValue

MakeConnectionString() public static method

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.
return string

MakeModulusClause() public method

public MakeModulusClause ( string fieldName ) : SqlClauseWithValue
fieldName string
return Azavea.Open.DAO.SQL.SqlClauseWithValue

NeedAsForColumnAliases() public method

public NeedAsForColumnAliases ( ) : bool
return bool

NeedToAliasColumns() public method

public NeedToAliasColumns ( ) : bool
return bool

SQLServerDescriptor() public method

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.
return System

SQLServerDescriptor() public method

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.
return System

SetParametersOnCommand() public method

public SetParametersOnCommand ( IDbCommand cmd, IEnumerable parameters ) : void
cmd IDbCommand
parameters IEnumerable
return void

TableAliasPrefix() public method

public TableAliasPrefix ( ) : string
return string

TableAliasSuffix() public method

public TableAliasSuffix ( ) : string
return string

ToCleanString() public method

public ToCleanString ( ) : string
return string

ToCompleteString() public method

public ToCompleteString ( ) : string
return string

UsePooling() public method

public UsePooling ( ) : bool
return bool

Property Details

Database public_oe property

The database name. May not be null.
public string Database
return string

Password public_oe property

The password for the User. May be null.
public string Password
return string

Server public_oe property

The server name. May not be null.
public string Server
return string

User public_oe property

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

_cleanConnStr protected_oe property

protected string _cleanConnStr
return string

_connectionStr protected_oe property

protected string _connectionStr
return string