Class DbProvider
- Namespace
- Quartz.Impl.AdoJobStore.Common
- Assembly
- Quartz.dll
Concrete implementation of IDbProvider.
public class DbProvider : IDbProvider
- Inheritance
-
DbProvider
- Implements
- Inherited Members
Remarks
A provider is described by its DbMetadata: the connection, command and parameter types to instantiate, the parameter prefix, and so on. Descriptions come from the container — the drivers Quartz ships descriptions for, plus anything the application registered — rather than from process-wide state, so two containers in one process no longer have to agree on what a provider name means.
This is the provider that constructs the driver's objects, and so the one that needs their types. When the description resolved them from a name — which is what naming a built-in driver does — a trimmed application has no guarantee they survived, and the constructor below is where that shows up. A provider that needs no type at all is the one built over a DbProviderFactory, or the data source path.
Constructors
DbProvider(DbMetadata, string)
Initializes a new instance of the DbProvider class from an already-resolved description of the driver.
public DbProvider(DbMetadata metadata, string connectionString)
Parameters
metadataDbMetadataThe metadata describing the ADO.NET driver.
connectionStringstringThe connection string.
DbProvider(string, string)
Initializes a new instance of the DbProvider class, described by one of the drivers Quartz ships a description for.
public DbProvider(string dbProviderName, string connectionString)
Parameters
Remarks
This overload has no container to ask, so it sees only the built-in descriptions. A driver Quartz
knows nothing about is described through the container instead — see the metadata callback on
UseGenericDatabase — which is also how a built-in description is replaced.
Properties
ConnectionString
Connection string used to create connections. Arrives through the implementation's constructor; a provider is fully usable once constructed.
public string ConnectionString { get; }
Property Value
Metadata
The database metadata for the provider.
public DbMetadata Metadata { get; }
Property Value
Methods
CreateCommand()
Returns a new command object for executing SQL statements/Stored Procedures against the database.
public virtual DbCommand CreateCommand()
Returns
- DbCommand
An new IDbCommand
CreateConnection()
Returns a new connection object to communicate with the database.
public virtual DbConnection CreateConnection()
Returns
- DbConnection
A new IDbConnection
Shutdown()
Shutdowns this instance.
public virtual void Shutdown()