フィルターのクリア

connecting mysql database to matlab

5 ビュー (過去 30 日間)
saisha
saisha 2011 年 2 月 17 日
コメント済み: Pieume Ulrich 2019 年 5 月 1 日
we are doing a project in matlab on image retrieval. we need to create a database and link it to matlab. plz tel us how to connect the database to matlab?????

採用された回答

John
John 2011 年 2 月 17 日
Perhaps you need something like this:

その他の回答 (1 件)

Nathan Orloff
Nathan Orloff 2011 年 11 月 10 日
1. Open the file here ($matlabroot/toolbox/local/classpath.txt). Write this in the text file and save it. $matlabroot/java/jarext/mysql-connector-java-5.1.6-bin.jar
2. Download this, mysql-connector-java-5.1.6-bin.jar
3. Place (2) in here, C:\MATLAB\R2010b\java\jarext
Now you should be able to use the database toolbox to connect. To connect to a database use this code:
% Database Server db_info.host = '111.111.111.111'; % Database Username/Password db_info.user = 'Matlab'; db_info.password = 'IsAwesome'; % Database Name db_info.dbname = 'Kittens';
%% Set up the Java string and drivers % Set this to the path to your MySQL Connector/J JAR jdbcString = sprintf('jdbc:mysql://%s/%s', db_info.host, db_info.dbname); jdbcDriver = 'com.mysql.jdbc.Driver';
%% Make the Connection to the database % Create the database connection object db_conn = database(db_info.dbname, db_info.user,... db_info.password, jdbcDriver, jdbcString);
  1 件のコメント
Pieume Ulrich
Pieume Ulrich 2019 年 5 月 1 日
I tried the method using R2017b version but it didnt work, I still had JDBC is not found on MATLAB java class. Please what do I need for it to be functional

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by