User`s guide

Other ODBC- or JDBC-Compliant Databases
2-189
Derby or Microsoft Windows Azure, here are some basic steps to follow. The details of
the steps below can vary depending on your database and database version. For details
about your database, contact your database administrator or refer to your database
documentation. The driver and URL fields (in Database Explorer Create a New JDBC
data source dialog box and in the database command) can vary depending on the type
and version of the JDBC driver and the database you are working with. For details about
the driver and URL, see the JDBC driver documentation for your database.
1
If your driver is not preinstalled on your computer, find a compatible driver and
install it on your computer.
2
Add the JDBC driver path to the static Java class path, or alternatively to the
dynamic Java class path. For details about static and dynamic class paths, see
“Bringing Java Classes into MATLAB Workspace”.
3
To connect to a JDBC-compliant database, you need to know your database driver
Java class object string. For example, the Java class object for a SQLite database
is org.sqlite.JDBC. Use this string for establishing a connection either with
Database Explorer in the Driver field or the command line in the driver argument.
4
To connect to a JDBC-compliant database, you need to create a URL string. The
URL string is in the form jdbc:subprotocol:subname. The jdbc part of this
string stays constant for any JDBC driver. The subprotocol is the database type.
The last part of the URL string is the subname. The subname contains the location
of the database and additional connection information such as the port number.
For example, if you are using SQLite, your string is jdbc:sqlite:dbpath, where
dbpath is the full path to your SQLite database on your computer. Use this string
for establishing a connection either with Database Explorer or the command line.
5
Use Database Explorer to test your connection. For details, see “Configure JDBC
Data Sources” on page 4-12.
6
Use Database Explorer to connect to your database. For details, see “Connect to a
Data Source” on page 4-16.
7
Alternatively, you can connect to your database using the command line function
database.
8
For more in-depth assistance, contact your database administrator or database
documentation. For more in-depth instructions, see the example “Sybase JDBC for
Windows” on page 2-97.
See Also
close | database