how to retrieve data(select statement) from mysql using matlab GUI
显示 更早的评论
hello..i'm still new in using this software..i want to ask.
this is my coding..i get from querybuilder after generate m.file. before this i try another trying..but fail..based on this, all data from my table, i get. but here my problem is how to retrieve data(select statement) from mysql using matlab GUI?another key is i want generate search button.
% Set preferences with setdbprefs.
s.DataReturnFormat = 'cellarray';
s.ErrorHandling = 'store';
s.NullNumberRead = 'NaN';
s.NullNumberWrite = 'NaN';
s.NullStringRead = 'null';
s.NullStringWrite = 'null';
s.JDBCDataSourceFile = 'C:\Users\farhana\Documents\MATLAB\farhana.mat';
s.UseRegistryForSources = 'yes';
s.TempDirForRegistryOutput = 'C:\Users\farhana\AppData\Local\Temp';
setdbprefs(s)
% Make connection to database. Note that the password has been omitted.
% Using JDBC driver.
conn = database('farhana','root','1234','com.mysql.jdbc.Driver','jdbc:mysql://localhost/farhana');
% Read data from database.
e = exec(conn,'SELECT ALL aa,bb FROM test');
e = fetch(e);
close(e)
% Close database connection.
close(conn)
hope anybody can help me..;) tq..
回答(1 个)
Oleg Komarov
2011-4-16
0 个投票
I would suggest you to read the neat example given in http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
类别
在 帮助中心 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!