how to retrieve data(select statement) from mysql using matlab GUI
Mostra commenti meno recenti
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..
Risposte (1)
Oleg Komarov
il 16 Apr 2011
0 voti
I would suggest you to read the neat example given in http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
Categorie
Scopri di più su Database Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!