User`s guide

2 Getting Started with Database Toolbox
2-174
Sybase JDBC for Mac OS X
This tutorial shows how to set up a data source and connect to your Sybase database.
This tutorial uses the jConnect 4 JDBC Driver to connect to the Sybase Adaptive Server
Enterprise 15.7 database.
In this section...
“Step 1. Verify the driver installation.” on page 2-174
“Step 2. Add the JDBC driver to the MATLAB static Java class path.” on page 2-174
“Step 3. Set up the data source using Database Explorer.” on page 2-175
“Step 4. Connect using Database Explorer or the command line.” on page 2-177
Step 1. Verify the driver installation.
If the JDBC driver for Sybase 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. Add the JDBC driver to the MATLAB static Java class path.
1
Run the prefdir command in the Command Window. The output is a file path to a
folder on your computer.
2
Close MATLAB if it is running.
3
Navigate to the folder and create a file called javaclasspath.txt in the folder.
4
Open javaclasspath.txt. Add the full path to the database driver JAR file
in javaclasspath.txt. The full path includes the path to the folder where
you downloaded the JAR file from the database provider and the JAR file
name. For example, /home/user/DB_Drivers/jconn4.jar. Save and close
javaclasspath.txt.
5
Restart MATLAB.
Alternatively, you can use javaaddpath to add your JDBC driver to the dynamic Java
class path. For details about static and dynamic class paths, see “Bringing Java Classes
into MATLAB Workspace”.