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!