This tutorial provides steps for configuring data sources and connecting to other ODBC-compliant or JDBC-compliant databases that are not listed in Configuring Driver and Data Source. After creating a data source, you can connect to your database using the Database Explorer app or the command line.
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:
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.
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.
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.
For detailed assistance, contact your database administrator or refer to your database documentation.
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.
If your driver is not installed on your computer, find a compatible driver and install it on your computer.
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.
In the Name box, enter a name for your data source. You use this name to establish a connection to your database.
From the Vendor list, select
Other
.
In the Driver Location box, specify the full path of the driver file.
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.
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.
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.
Click Test to test your connection. If the connection is successful, then click Save to save the JDBC data source.
Connect to your database with the saved JDBC data source by using the Database Explorer app. For an example, see SQLite JDBC for Windows.
If your driver is not installed on your computer, find a compatible driver and install it on your computer.
Create a data source using the databaseConnectionOptions
function.
Set the JDBC connection options using the setoptions
function.
Test the database connection using the testConnection
function.
Save the JDBC data source using the saveAsDataSource
function.
Connect to your database with the saved JDBC data source by using the
database
function. For
an example, see SQLite JDBC for Windows.
close
| configureODBCDataSource
| database
| databaseConnectionOptions
| saveAsDataSource
| setoptions
| testConnection