Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a MySQL database that I connect to using Mathematica and would like to distribute my Mathematica code to others. We already have ODBC DSNs setup on peoples machines using the MySQL ODBC connector. I've done a similar thing before in R using RODBC.

I attempted to use this;

Needs["DatabaseLink`"];
JDBCDrivers["ODBC(DSN)"]
conn = OpenSQLConnection[JDBC["ODBC(DSN)", "DatabaseName"]];

Which looked like it was going to work but after reading the documentation it seems that it uses a JDBC-ODBC bridge which I can't assume people have installed.

My question is can Mathematica use a ODBC connection (without a bridge) and if so how? If I have to use a JDBC connection then that's fine but I want to make sure that I'm not missing something.

share|improve this question
    
Doesn't bring the standard mathematica installation such a preconfigured bridge, at least on Windows? From the DatabaseLink documentation: "DatabaseLink comes configured with a driver for ODBC connections". So I think you can assume it to be installed if people run your Mathematica code. On the other hand, if you are accessing a MySQL database, why not use the mysql-jdbc driver directly, which also seems to be delivered ready to use with DatabaseLink? –  Albert Retey May 2 '13 at 14:17
    
Thanks Albert. You're right the documentation does say that (the code that I posted came from the same page). I'll try to get the error message from the user and post it. I want to use a DSN instead of typing in the server location, that's why I'm not using the mysql-jdbc driver. –  Cam May 2 '13 at 23:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.