Class DriverManager
Definition
- Assembly:
- Tizen.Data.Tdbc.dll
DriverManager loads TDBC drivers and gets connections to databases.
public class DriverManager
- Inheritance
-
objectDriverManager
Methods
View SourceGetConnection(string)
Get connection of registered database and open the database.
Declaration
public static IConnection GetConnection(string connectionString)
Parameters
Type | Name | Description |
---|---|---|
string | connectionString | The string for connect and open database. |
Returns
Type | Description |
---|---|
IConnection | The connection object. |
Remarks
If the driver uses database at filesystem, such as media storage or external storage, you need to declare a proper privilege such as http://tizen.org/privileges/mediastorage or http://tizen.org/privileges/externalstorage.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | No driver registered. |
System.SystemException | Failed to open database connection. |
System.UnauthorizedAccessException | .The application doesn't have permission or privilege to access database. |
GetConnection(Uri)
Get connection of registered database and open the database.
Declaration
public static IConnection GetConnection(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | The uri represents database to connect. |
Returns
Type | Description |
---|---|
IConnection | The connection object. |
Remarks
If the driver uses database at filesystem, such as media storage or external storage, you need to declare a proper privilege such as http://tizen.org/privileges/mediastorage or http://tizen.org/privileges/externalstorage.
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | No driver registered. |
System.SystemException | Failed to open database connection. |
System.UnauthorizedAccessException | .The application doesn't have permission or privilege to access database. |
RegisterDriver(string)
Registers and loads the TDBC driver with the given driver name.
Declaration
public static void RegisterDriver(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of TDBC driver. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The given name is null. |
System.ArgumentException | The given name is zero-length string. |
System.BadImageFormatException | The given driver is not a valid assembly. |