Effacer les filtres
Effacer les filtres

Connecting to Oracle express

6 vues (au cours des 30 derniers jours)
Paul
Paul le 8 Juil 2014
Commenté : Paul le 11 Juil 2014
I am having troubles connecting to oracle express db. When i am trying to connect to the database i get the following error:
>> conn = database('test_db','','zxcv','Vendor','Oracle',...
'DriverType','oci','Server','remotehost','PortNumber',
1234)
Error using database (line 309)
Java exception occurred:
java.lang.UnsatisfiedLinkError: no ocijdbc11 in
java.library.path
  10 commentaires
Rodrigo
Rodrigo le 11 Juil 2014
Modifié(e) : Rodrigo le 11 Juil 2014
you're welcome... So, i'm Rodrigo Muñoz!!! See you my friend!
Paul
Paul le 11 Juil 2014
nice!

Connectez-vous pour commenter.

Réponse acceptée

Sruthi Ayloo
Sruthi Ayloo le 10 Juil 2014
The usage of database function is as follows:
conn = database('databasename','username','password','oracle.jdbc.driver.OracleDriver',jdbc:oracle:thin:@IP_ADDRESS_OF_DATABASE_SERVER:1521:databasename');
In the Query Builder, the database 'Name' should be the same as the suffix after the port number in the database 'URL', that is, the 'databasename' must be same as the SID parameter at the end of the 'databaseurl'. In your code, the instance parameter should be “dbname”.
  1 commentaire
Paul
Paul le 10 Juil 2014
First of all, thank you very much for the quick reply Sruthi, I do not know the database name neither the password and i never created one. I only know that i created a password for oracle express database during the installation.

Connectez-vous pour commenter.

Plus de réponses (4)

Sruthi Ayloo
Sruthi Ayloo le 9 Juil 2014
The Oracle DLL that the Database drivers need could not be detected in MATLAB. Add the location of the Oracle DLLs path to the following file and restart MATLAB.
$MATLAB/toolbox/local/javalibrarypath.txt.

Paul
Paul le 9 Juil 2014
i followed your procedure as well as the procedure of mathworks step 3 but the error persists and i dont know why, i even added the .dll file manually in matlab.
my javalibrarypath.txt contains these elements in my case:
C:\oraclexe\app\oracle\product\11.2.0\server\oci\lib C:\oraclexe\app\oracle\product\11.2.0\server\bin\ocijdbc11.dll

Paul
Paul le 10 Juil 2014
I tried a different connection command now which gives me more details concerning the error. This is how i connect:
conn = database('','username','pwd',...
'Vendor','Oracle',...
'URL',['jdbc:oracle:thin:@(DESCRIPTION = ' ...
'(ADDRESS = (PROTOCOL = TCP)(HOST = sname)' ...
'(PORT = 123456)) (CONNECT_DATA = ' ...
'(SERVER = DEDICATED) (SERVICE_NAME = dbname) ) )']);
nothing shows up afterwards the command, but when i have a look at the variable "conn" it indicates the following
val =
Instance: ''
UserName: 'username'
Driver: []
URL: []
Constructor: [1x1 com.mathworks.toolbox.database.databaseConnect]
Message: 'Error de E/S: The Network Adapter could not establish the connection'
Handle: 0
TimeOut: 5
AutoCommit: 'off'
Type: 'Database Object'
Any suggestions?

Paul
Paul le 11 Juil 2014
Question was answered by Rodrigo

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by