User`s guide
2 Getting Started with Database Toolbox
2-48
Oracle JDBC for Windows
This tutorial shows how to set up a data source and connect to your Oracle database.
This tutorial uses the Oracle Database 11g Release 2 (11.2.0.3) JDBC driver for use with
JDK™ 1.6 to connect to the Oracle 11g Enterprise Edition Release 11.2.0.1.0 database.
In this section...
“Step 1. Verify the driver installation.” on page 2-48
“Step 2. Set up the operating system authentication.” on page 2-48
“Step 3. Add the JDBC driver to the MATLAB static Java class path.” on page 2-49
“Step 4. Set up the data source using Database Explorer.” on page 2-49
“Step 5. Connect using Database Explorer or the command line.” on page 2-52
Step 1. Verify the driver installation.
If the JDBC driver for Oracle is not installed on your computer, find the link on the
Driver Installation page to install the driver. Follow the instructions to download and
install this driver on your computer.
Step 2. Set up the operating system authentication.
Set up operating system authentication for Windows. Operating system authentication
allows you to connect to your database using your system or network user name
and password. In this case, the database does not require a different user name and
password. Operating system authentication facilitates connection to the database and
provides easy maintenance of database access credentials.
1
Ensure you have the latest Oracle OCI libraries installed on your computer. To
install the latest library, see Driver Installation.
2
Run the prefdir command in the Command Window. The output of this command
is a file path to a folder on your computer.
3
Close MATLAB if it is running.
4
Navigate to the folder and create a file called javalibrarypath.txt in the folder.
5
Open javalibrarypath.txt and insert the path to the Oracle OCI libraries. The
entry should include the full path to the library files. The entry should not contain
the library file names. For example, C:\DB_Libraries\instantclient_11_2.