how to retrieve data(select statement) from mysql using matlab GUI
Mostrar comentarios más antiguos
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..
Respuestas (1)
Oleg Komarov
el 16 de Abr. de 2011
0 votos
I would suggest you to read the neat example given in http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
Categorías
Más información sobre Database Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!