Database Toolbox - Connecting to an Oracle Database

I need to connect a MATLAB application I am writing to an Oracle database (both 10 and 11) to acquire data from the tables stored there. While I am experienced in MATLAB, I have no prior experience with working with databases, however, I have read a few of the other posts on the MATLAB newsgroup regarding subject. I would like confirm how to connect to an Oracle database.

I know that the connection command for the database toolbox is:

conn = database('<Database Instance>','<username>,'<password>','oracle.jdbc.driver.OracleDriver','jdbc:oracle:oci7:<database URL>');

However, I have the following question about other commands to run and the exact syntax.

-Before connection, does the oracle driver needs to be loaded into MATLAB via the 'javaaddpath' command? Should the .JDBC drivers be downloaded from Oracle, placed into a directory, and then javaaddpath be executed with that directory in the arguments? How is the .jar driver added to MATLAB?

-For the database URL, is there a unique syntax to use, so for example should the URL be written ''jdbc:oracle:oci7:@localhost:port' or ''jdbc:oracle:oci7:\\localhost:port' ?

-Is the driver argument ('oracle.jdbc.driver.OracleDriver') the same for different Oracle versions?

Answers to any of these questions would be appreciated. Also, if there is any example syntax that includes the commands for the .jar files, that would be helpful too.

Thank you,
11/30/2011 8:01:09 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies

Similar Articles

[PageSpeed] 5