Main Content

Other ODBC-Compliant or JDBC-Compliant Databases

This tutorial provides steps for configuring data sources and connecting to other ODBC-compliant or JDBC-compliant databases that are not listed in Configure Driver and Data Source. After creating a data source, you can connect to your database using the Database Explorer app or the command line.

ODBC-Compliant Databases

These steps show how to configure a driver and connect to an ODBC-compliant database. Database Toolbox™ can connect to any ODBC-compliant database that is relational and uses ANSI® SQL. For example, if your database is Microsoft® Excel® or IBM DB2®, follow these basic steps:

  1. If your driver is not preinstalled on your computer, find a compatible driver and install it on your computer. You can view preinstalled drivers using the Microsoft ODBC Data Source Administrator dialog box. For details about this dialog box, see Driver Installation.

  2. Create a data source by using the installed driver and the Microsoft ODBC Data Source Administrator dialog box. To open this dialog box, use the configureODBCDataSource function.

  3. Use the Database Explorer app to test your connection and connect to your database. For an example, see MySQL ODBC for Windows.

    Or, you can connect to your database using the database function at the command line.

  4. For detailed assistance, contact your database administrator or refer to your database documentation.

JDBC-Compliant Databases

You set up a data source to a JDBC-compliant database using the Database Explorer app or the command line.

These steps show how to configure a driver and connect to a JDBC-compliant database. Database Toolbox can connect to any JDBC-compliant database that is relational and uses ANSI SQL. For example, if your database is Apache® Derby or Microsoft Windows® Azure®, follow these basic steps:

Note

The details of these steps can vary depending on your database and database version. For detailed assistance, contact your database administrator or refer to your database documentation.

Set Up Data Source Using Database Explorer

  1. If your driver is not installed on your computer, find a compatible driver and install it on your computer.

  2. Create a data source by using the JDBC Data Source Configuration dialog box. In the Data Source section of the Database Explorer tab, select Configure Data Source > Configure JDBC data source to open the dialog box.

  3. In the Name box, enter a name for your data source. You use this name to establish a connection to your database.

  4. From the Vendor list, select Other.

  5. In the Driver Location box, specify the full path of the driver file.

  6. To connect to a JDBC-compliant database, you must know your database driver Java® class object. For example, the Java class object for an SQLite database driver is org.sqlite.JDBC. In the Driver box, specify the driver value.

  7. To connect to a JDBC-compliant database, you must create a URL string. The URL string has the form jdbc:subprotocol:subname. The jdbc part of this string remains constant for any JDBC driver. subprotocol is the database type. The subname contains the location of the database and additional connection information, such as the port number. For example, if you are using SQLite, the URL string is jdbc:sqlite:dbpath, where dbpath is the full path to your SQLite database on your computer. In the URL box, specify the URL string.

    Note

    For JDBC-compliant databases, specify the driver and URL in the JDBC Data Source Configuration dialog box. The driver and the URL string can vary depending on the type and version of the JDBC driver and your database. For details about the driver and URL, see the JDBC driver documentation for your database.

  8. Under Connection Options, in the Name column, enter the name of an additional driver-specific option. Then, in the Value column, enter the value of the driver-specific option. Click the plus sign + to specify additional driver-specific options.

  9. Click Test to test your connection. If the connection is successful, then click Save to save the JDBC data source.

  10. Connect to your database with the saved JDBC data source by using the Database Explorer app. For an example, see SQLite JDBC for Windows.

Set Up Data Source Using Command Line

  1. If your driver is not installed on your computer, find a compatible driver and install it on your computer.

  2. Create a data source using the databaseConnectionOptions function.

  3. Set the JDBC connection options using the setoptions function.

  4. Test the database connection using the testConnection function.

  5. Save the JDBC data source using the saveAsDataSource function.

  6. Connect to your database with the saved JDBC data source by using the database function. For an example, see SQLite JDBC for Windows.

See Also

Apps

Functions

Related Examples

More About