Database Reference
HSQLDB
HSQLDB is a relational database engine written in Java that is bundled with
DatabaseLink, which also contains a JDBC driver and necessary configuration. It offers a small (about 100k), fast database engine, which can run in a variety of ways, including server, in-process, and in-memory modes.
DatabaseLink is configured to use an in-process stand-alone mode. This makes it very simple to run and use (no special configuration is required). However, it means that nothing else can connect to the database and only one connection to a particular database can be made at any one time (even by multiple copies of
Mathematica).
To create a new database with HSQLDB, you just need to make a connection to a database that does not already exist, and HSQLDB will create it for you. You could use the Connection Tool, which will deploy a wizard and write a named connection. This is described in
"The Database Explorer: The Connection Tool". You could also write a connection file and place this in a
DatabaseResources directory, as described in
"Database Resources: Connection Configuration". Finally, you can use
OpenSQLConnection as follows. All of these issues are described in
"Database Connections".
The following is a sample command that will create a new database called
example.
The details of the HSQLDB driver in
DatabaseLink can be seen as follows.
| Out[2]= |  |
To connect to an HSQLDB database you would typically give the filename, username, and password as in the following example.
For more information, see
hsqldb.sourceforge.net/.
MySQL
The MySQL database server is an extremely popular open source database. It is used in many different types of applications.
DatabaseLink comes configured with a driver for MySQL.
If you want to create a new database for MySQL, you should contact the server administrator.
The details of the MySQL driver in
DatabaseLink can be seen as follows.
| Out[2]= |  |
To connect to a MySQL database you would typically set the server, database, username, and password as in the following example.
For more information, see
www.mysql.com/.
ODBC
Open Database Connectivity (ODBC) is a general way to connect to SQL databases that is supported in a number of operating systems, particularly Microsoft Windows.
DatabaseLink comes configured with a driver for ODBC connections.
Under Windows, there is an ODBC Data Source Administrator that can be used to connect to a variety of different databases.
Database Connections: ODBC Connections shows how to connect to a database using ODBC.
The details of the ODBC driver in
DatabaseLink can be seen as follows.
| Out[2]= |  |
To connect to an ODBC database you would typically use a data source name as in the following example.
SQL Server
Support for Microsoft SQL Server is provided by the jTDS driver.
The details of the SQL Server driver in
DatabaseLink can be seen as follows.
To connect to a Microsoft SQL Server database you would typically set the server, database, username, and password as in the following example.
For more information, see:
jtds.sourceforge.net/ an open source driver for Microsoft SQL Server and Sybase.
Sybase
Support for Sybase is provided by the jTDS driver.
The details of the Sybase driver in
DatabaseLink can be seen as follows.
To connect to a Microsoft SQL Server database you would typically set the server, database, username, and password as in the following example.
For more information, see:
jtds.sourceforge.net/ an open source driver for Microsoft SQL Server and Sybase.
Other Databases
DatabaseLink can connect to any other type of database with a JDBC driver. You can install the driver by following the instructions in
Database Connections: JDBC Connections and
Database Resources: JDBC Configuration.
Information on how to obtain and install drivers as well as configuring connection information for a number of databases is available at
www.wolfram.com/solutions/connections/database/vendors.html.
JDBC
The Java Database Connectivity API:
java.sun.com/products/jdbc/.