Interacting with databases
Open Database Connectivity (ODBC) is a low-level protocol for establishing connections with the majority of databases and datasources ( for more details, refer to http://en.wikipedia.org/wiki/Open_Database_Connectivity).
Julia has an ODBC
package that enables Julia scripts to talk to ODBC data sources. Install the package through Pkg.add("ODBC")
, and at the start of the code, run it using ODBC
.
The package can work with a system Data Source Name (DSN) that contains all the concrete connection information, such as server name, database, credentials, and so on. Every operating system has its own utility to make DSNs. In Windows, the ODBC administrator can be reached by navigating to Control Panel
| Administrative Tools
| ODBC Data Sources
; on other systems, you have IODBC or Unix ODBC.
For example, suppose we have a database called pubs
running in a SQL Server or a MySQL Server, and the connection is described with a DSN pubsODBC
. (Included in the code download is a...