Skip to content

DbGate class

Represents base class which allows to get DB structure information availble for some connection

public abstract class Korzh.EasyQuery.Db.DbGate
TypeNameDescription
StringfinalConnectionStringWhen overriden in derived class, return the connection
TypeNameDescription
BooleanConnectedGets or sets a value indicating whether this DbGate is connected. When this property is assigned to true then the object tries to connect to database.
DbConnectionConnectionGets the connection.
StringConnectionStringGets or sets the connection string.
IConnectionStringBuilderDlgConnectionStringBuilderDlgGets or sets the connection string builder dialog.
BooleanLoginPromptGets or sets a value indicating whether Korzh.EasyQuery.Db.DbGate object should ask user for login and password when connect to database.
StringPasswordGets or sets the “Password” parameter of database connection.
IProgressIndicatorProgressIndicatorGets or sets the progress indicator object.
StringUserIDGets or sets the “User ID” parameter of database connection.
BooleanUseViewsGets or sets a value indicating whether Korzh.EasyQuery.Db.DbGate will add views in the list of tables returned by Korzh.EasyQuery.Db.DbGate.GetTables(System.String,System.String) method.
StringVersionGets the version of the current Korzh.EasyQuery.Db.DbGate implementation
TypeNameDescription
LoginRequestEventHandlerLoginRequestOccurs when the Korzh.EasyQuery.Db.DbGate objects needs to get Korzh.EasyQuery.Db.DbGate.UserID and Korzh.EasyQuery.Db.DbGate.Password to connect to some database.
TypeNameDescription
StringAssembleConnectionString()Builds the final connection string based on the string defined in Korzh.EasyQuery.Db.DbGate.ConnectionString property, current environment variables and the parameters defined in UserID and Password properties.
voidCheckConnection()Checks the connection. Calls CoreCheckConnection() method.
voidCoreCheckConnection()When overriden in derived class, performs the actual connection checking
voidCoreGetDatabases(DbInfoList databases)Core implementation of Korzh.EasyQuery.Db.DbGate.GetDatabases method.
voidCoreGetFields(String dbName, String schemaName, String tableName, DbFieldInfoList fields)Core implementation of Korzh.EasyQuery.Db.DbGate.GetFields(System.String,System.String,System.String) method.
voidCoreGetFieldsBySQL(String sql, DbFieldInfoList fields)Core implementation of Korzh.EasyQuery.Db.DbGate.GetFieldsBySQL(System.String) method.
voidCoreGetLinks(String dbName, String schemaName, DbLinkInfoList links)Core implementation of Korzh.EasyQuery.Db.DbGate.GetLinks(System.String,System.String) method.
voidCoreGetTables(String dbName, String schemaName, DbTableInfoList tables)Core implementation of Korzh.EasyQuery.Db.DbGate.GetTables(System.String,System.String) method.
voidCoreLoadParams(DbParameters dbParams)Core implementation of Korzh.EasyQuery.Db.DbGate.LoadParams(Korzh.EasyQuery.Db.DbParameters) method.
voidCoreSaveParams(DbParameters dbParams)Core implementation of Korzh.EasyQuery.Db.DbGate.SaveParams(Korzh.EasyQuery.Db.DbParameters) method.
BooleanGetConnected()Core implemenation of “get” method of Korzh.EasyQuery.Db.DbGate.Connected property.
DbConnectionGetConnection()When overriden in derived class, returns the connection
DbDataAdapterGetDataAdapter(String sqlText)Gets the data adapter.
DbInfoListGetDatabases()Gets the list of available databases.
DbFieldInfoListGetFields(String dbName, String schemaName, String tableName)Gets the fields by table.
DbFieldInfoListGetFieldsBySQL(String sql)Gets the fields of result set of some SQL statement execution.
DbFieldInfoListGetFieldsEx(String dbName, String schemaName, String tableName, Boolean sortByOriginalPosition)Gets the fields by table.
FormatTypeGetFormatType()Returns the format type for this DB gate
DbLinkInfoListGetLinks(String dbName, String schemaName)Gets the list of available tables.
StringGetName()Gets the name of Korzh.EasyQuery.Db.DbGate. Must be overrided in inherited classes
StringGetPwdName()Gets the name of “password” attribute in connection string.
StringGetSqlDialect()Gets the name of default SQL dialect. Can be overrided in inherited classes
DbTableInfoListGetTables(String dbName, String schemaName)Gets the list of available tables.
StringGetUidName()Gets the name of User ID attribute in connection string
StringGetVersion()Core implemenation of Korzh.EasyQuery.Db.DbGate.Version property. Must be overrided in descendants.
voidLoadParams(DbParameters dbParams)Loads the connection parameters.
voidLogDebug(String message, Object[] args)
voidLogError(String message, Object[] args)
voidLogInfo(String message, Object[] args)
voidOnLoginRequest()Raises the LoginRequest event and filled UserID and Password by values returned in event arguments
voidSaveParams(DbParameters dbParams)Saves the connection parameters.
voidSetConnected(Boolean connected)Core implemenation of “set” method of Korzh.EasyQuery.Db.DbGate.Connected property.
voidSetLogger(ILogger logger)Set a logger
voidSetProgress(Int32 pos)Set the progress to the specified position.
voidSetProgressMinMax(Int32 min, Int32 max)Sets the minimum and maximum of progress indicator.
StringToString()Returns a System.String that represents the current System.Object.
TypeNameDescription
Collection<Type>DbGateTypesThe list of all registered DbGate types (descendants of DbGate)
TypeNameDescription
SqlDbTypeDbTypeByDataType(DataType dt)Gets SqlDbType object which coressponds to DataType object specified in parameter
voidRegister(Type gateType)Registers the specified gate type.