Error of update(conn,tablename,colnames,data,whereClause) by using matlab connect ODBC and mySQL server 5.6 -
isn't coding typing wrong way? need create update button user can edit information using matlab. after update, button need connect mysql server 5.6 , odbc connector. code:
% --- executes on button press in update. function update_callback(hobject, eventdata, handles) % hobject handle update (see gcbo) % eventdata reserved - defined in future version of matlab % handles structure handles , user data (see guidata) %display dialog box confirm save choice = questdlg('confirm update database?', ... '', ... 'yes','no','yes'); % handle dialog box response switch choice case 'yes' %set preferences setdbprefs. setdbprefs('datareturnformat', 'cellarray'); %make connection database. conn = database('animal_cbir', '', ''); %test if database connection valid testconnection = isconnection(conn); disp(testconnection); fileid = getappdata(0,'namevalue'); imageid = fileid; name = get(handles.edit11,'string'); commonname = get(handles.edit1,'string'); scientificname = get(handles.edit2,'string'); class = get(handles.edit3,'string'); diet = get(handles.edit4,'string'); habitat = get(handles.edit5,'string'); lifespan = get(handles.edit6,'string'); size = get(handles.edit7,'string'); weight = get(handles.edit8,'string'); characteristic = get(handles.edit10,'string'); tablename = 'animal'; colnames ={'imageid','name','commonname','scientificname','class','diet','habitat','lifespan','size','weight','characteristic'}; data = {imageid,name,commonname,scientificname,class,diet,habitat,lifespan,size,weight,characteristic}; disp (data); whereclause = sprintf(['where imageid = "%s"'],fileid); update(conn,tablename,colnames,data,whereclause); updatesuccess = helpdlg('existing animal species updated in database.'); commit(conn); case 'no' end
error getting:
no method 'setint' matching signature found class 'sun.jdbc.odbc.jdbcodbcpreparedstatement'.
hope can me solve it.
Comments
Post a Comment