Why am I having problems connecting to a remote Oracle 9.2 database using the Database Toolbox?

2 views (last 30 days)
I am having trouble connecting to Oracle database software version 9.2.0.1.0 using the Database Toolbox 3.0.1. The database is on a remote server (Sun Solaris). I receive the following error when I attempt to run the EXEC command:
no constructor with com.mathworks.toolbox.database.sqlExec with matching signature found.
When I read the Message field of the database connection object as follows:
conn = database(...)
conn.Message
I get the following message:
Invalid Oracle URL specified
However, I am able to connect to the Oracle database, using this URL, from Java code outside of MATLAB. I am using an OCI driver to connect to the database and even upgraded to MATLAB 7.0.4 (R14SP2) to try to resolve the issue.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 3 Aug 2009
We recommend that you use the JDBC thin drivers as they are easier to configure than OCI drivers. For JDBC thin drivers, the $MATLAB/toolbox/local/classpath.txt entry appears similar to:
/home/username/classes111.zip
To make a connection using a JDBC thin driver specify the driver and URL as follows:
Driver: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:thin:@192.171.xxx.xx:xxxx:
The Oracle OCI JDBC drivers are type 2 drivers, meaning that there is additional software beyond the base Oracle installation that must be installed. The OCI client software consists of additional libraries that the JDBC OCI drivers need in order to make the connection to Oracle. The location of these installed libraries must be included in the file $MATLAB/toolbox/local/librarypath.txt.
For example, for a UNIX system, if Oracle is installed in /oracle/ora92, the entry in librarypath.txt would appear as
/oracle/ora92/lib32
The files in that directory are:
For Windows:
ocijdbc9.dll
ocijdbc9_g.dll
heterox.dll
heterox_g.dll
(_g indicates debug version)
For UNIX:
Files have .lib extension, ie ocijdbc9.lib
To make a connection using a JDBC OCI driver, specify the driver and URL as follows:
Driver: oracle.jdbc.driver.OracleDriver
URL (example): jdbc:oracle:oci8:@fogo
Please see the information below for other possible errors with respect to connecting to database using OCI drivers and the way(s) to workaround them:
1)
??? Java exception occurred:
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path
This error appears if MATLAB cannot locate the libraries; to workaround this, update 'librarypath.txt' file in the location $MATLAB/toolbox/local/ as described above.
2)
??? Java exception occurred:
java.lang.UnsatisfiedLinkError: no ocijdbc9.dll in java.library.path
This is the result of a path issue. To workaround this issue, try putting the connection script(MATLAB code) in the same directory as the OCI DLL files and run it from there.
3)
SEVERE: Error while registering Oracle JDBC Diagnosability MBean.
....
The issue would be because of incompatible java drivers. To workaround this, update java drivers

More Answers (0)

Products


Release

R14SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!