|
Home > Documentation > User Guide > Configuration API > SQL Managers
Versions: English
View Printer Friendly Version
Drepecated Feature
The old SQL IO Manager functionality was removed in the 0.5.x releases of dotNetRDF, documentation is preserved here for reference only and we strongly recommend you do not use older versions of dotNetRDF that support this feature any more.
Introduction
SQL IO Managers can be specified in order to provide connections to SQL based stores. Currently it is possible to load connections to any of the three supported SQL databases from configuration.
Microsoft SQL Server Configuration
Defining a connection to Microsoft SQL Server would look like the following:
@prefix <http://www.dotnetrdf.org/configuration#> .
_:sqlServer a dnr:SqlIOManager ;
dnr:type "VDS.RDF.Storage.MicrosoftSqlStoreManager" ;
dnr:server "sql.example.com" ;
dnr:database "example_database" ;
dnr:user "username" ;
dnr:password "password" .
As can be seen the configuration is fairly self-explanatory. A number of the triples can be omitted if you don't need to change the setting from the default. For example omitting the dnr:server triple will cause the connection to be made to a SQL server on localhost. Omitting the dnr:user and dnr:password properties will cause integrated authentication mode to be used i.e. your Windows user credentials are used.
MySql Server Configuration
Defining a connection to MySql Server would look like the following:
@prefix <http://www.dotnetrdf.org/configuration#> .
_:mySql a dnr:SqlIOManager ;
dnr:type "VDS.RDF.Storage.MySqlStoreManager" ;
dnr:server "mysql.example.com" ;
dnr:database "example_database" ;
dnr:user "username" ;
dnr:password "password" .
As with Microsoft SQL Server connections omitting the dnr:server property results in a connection to localhost being made. For MySql connections the username and password are required.
Virtuoso Universal Server Connection
Defining a connection to a virtual database accessed via Virtuoso Universal Server would look like the following:
Defining a connection to Microsoft SQL Server would look like the following:
@prefix <http://www.dotnetrdf.org/configuration#> .
_:virtuoso a dnr:SqlIOManager ;
dnr:type "VDS.RDF.Storage.NonNativeVirtuosoManager" ;
dnr:server "virtuoso.example.com" ;
dnr:port "1234" ;
dnr:database "example_database" ;
dnr:user "username" ;
dnr:password "password" .
Again for Virtuoso omitting the dnr:server property causes a connection to be made to localhost. If you omit the dnr:port setting then the Virtuoso default port of 1111 will be used. As for MySql the username and password are required.
Further Reading: IO Managers |