3
$\begingroup$

I try to connect to an Oracle database with Mathematica but I get this error:

DBC::classnotfound: oracle.jdbc.driver.OracleDriver"

My code:

OpenSQLConnection[
 JDBC["oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@ip_server:databasename"], 
 "Name" -> "datbasename", "Username" -> "myusername", "Password" -> "mypassword"]

I tried to use this instruction to connect database:

https://stackoverflow.com/questions/7178647/how-to-connect-an-oracle-database-to-mathematica

but this yields the same result.

I can connect to mySQL database but with Oracle databases I have this problem.

$\endgroup$
2
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – user9660
    Dec 16, 2015 at 11:39
  • 4
    $\begingroup$ You need to specify some additional information, like what Mathematica version you are running, on what OS, what Oracle driver (name, version) you downloaded and where you installed it. $\endgroup$ Dec 16, 2015 at 12:56

1 Answer 1

2
$\begingroup$

You might want to explicitly add the Oracle JDBC jar to the CLASSPATH used by Mathematica.

Needs["JLink`"];
AddToClassPath[FileNameJoin[{"/path/to/directory/with/jar","ojdbc6.jar"}]];
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.