The configuration process in Linux is the same as that in Windows:
1. Copy the jar package of oracle JDBC to the relevant directory of MATLAB (../Matlab/Java/JAR/toolbox.
The JDBC à lib (for example,/APP/Administrator/product/11.1.0/client_1/jdbc/LIB) in the Oracle 11g installation directory contains four files: ojdbc5.jar, ojdbc5_g.jar, ojdbc6.jar, and ojdbc6_g.jar.
Ojdbc5.jar and ojdbc5_g.jar are used in jdk1.5 and ojdbc6.jar and ojdbc6_g.jar are used in jdk1.6. Copy ojdbc6.jar to the Java/JAR/toolbox directory in the MATLAB main directory.
For example:
Oracle 11g is used on the Oracle server.
Copy the ojdbc6.jar package to the D:/Matlab/r2008b/Java/JAR/toolbox directory.
Note:
1. The client's ojdbc6.jar exists in the./product/11.1.0/client_1/jdbc/lib directory.
2. The ojdbc6.jar on the server exists in the./product/11.1.0/db_1/jdbc/lib directory.
2. Configure the classpath.txt file of MATLAB
Open the./Matlab/toolbox/localdirectory and edit the classpath.txt file. Add the following lines:
$ Maid/Java/JAR/toolbox/ojdbc6.jar
And save.
3. Establish a JDBC connection test to Oracle in MATLAB.
> Conn = database ('orcl ', 'Scott', '123 ',
'Oracle. JDBC. Driver. oracledriver ',
'Jdbc: oracle: thin: @ 192.168.0.101: 1521 :');
(Press enter)
Parameter description:
Orcl: Database Service name
SCOTT: User Name
123456: User Password
Oracle. JDBC. Driver. oracledriver: Driver
JDBC: oracle: thin: @ 192.168.0.101: 1521: connection string