From: husnul khotimah on
hi again,
i have some problems with my codes, i need to store d array into a mySQL database, but it has these error messages :

??? No constructor 'com.mathworks.toolbox.database.sqlExec' with matching signature found.

Error in ==> cursor.cursor at 60
curs.Cursor = com.mathworks.toolbox.database.sqlExec(curs.SQLQuery ,connect.Handle);

Error in ==> database.exec at 34
curs=cursor(connect,sqlQuery);

Error in ==> database.insert at 168
cursTemp=exec(connect,writeString);

ive read that it's caused by a running out of a memory, but i dont know how to solve it, this is a full codes of my program :
[conn,y] = konekDB;
% mat_input =['DU10X2';'CS2014';'MA1223';'IS3013';'CS2023';'DU1102';'DU2102';'FI1113';'FI1123';'CS3204';'CS3143';'CS3163';'CS3623';'MA1114';'MA1124';'KI1103';'MA2713';'IE2213';'MA2333';'CS2624';'DU1202';'CS1023';'CS3213';'DU1203';'DU2312';'CS2911';'CS2921';'CS3911';'FI1911';'FI1921';'MA2513';'SE2423';'CS3723';'SE3414';'CS3334';'CS3613';'CS2323';'DU3002';'CS3113'];
% mat_target = ['CS4333';'CS4353';'CS4323';'CS4102';'CS4633';'CS4802';'CS4723';'CS4713';'CS4643';'CS4613';'CS4002';'AA4822'];

que_target='select distinct mk_target from info_gain ORDER BY mk_target ASC';
mk_target = kueri(que_target);
%buat kombinasi pasangan 3 mk target
idxKombinasiTarget=combntns(1:12,3);
for aa=1:size(idxKombinasiTarget,1)
for bb=1:size(idxKombinasiTarget,2)
klPrediksi(aa,bb)=mk_target(idxKombinasiTarget(aa,bb));
end
end
%hitung jumlah input mata kuliah yang targetnya sudah digabung
for aa=1:size(idxKombinasiTarget,1)
jmlMkInputMerged(1,aa)=hitungMkInput(klPrediksi(aa,:));
end
%urut klompok mk target berdasarkan jml mk input dari kecil ke besar
[jmlMkInputSorted,idx]=sort(jmlMkInputMerged,2,'ascend');
% chosenIdxKlPred(1,:)=idxKombinasiTarget(idx(1,1),:);
chosenIdxKlPred(1,1) = idx(1,1);
%simpan elemen index yang terpilih
chosenElements(1,:)=idxKombinasiTarget(idx(1,1),:);
inc=2;
for aa=2:size(idx,2)
loncat=0;
kandidatElemen=idxKombinasiTarget(idx(1,aa),:)
for bb=1:size(kandidatElemen,2)
for cc=1:size(chosenElements,2)
if (kandidatElemen(1,bb)==chosenElements(1,cc))
loncat=1;
break
else
if (bb == size(kandidatElemen,2) && cc == size(chosenElements,2))
chosenIdxKlPred(1,inc)=idx(1,aa);
inc=inc+1;
for dd=1:size(kandidatElemen,2)
chosenElements(1,size(chosenElements,2)+1)=kandidatElemen(1,dd);
end
end
if (size(chosenElements,2)==12)
loncat=2;
break
end
end
end
if (loncat==1)
break
end
end
if (loncat==2)
break
end
end
for aa=1:size(chosenIdxKlPred,2)
chosenKlPred(aa,:)=klPrediksi(chosenIdxKlPred(1,aa),:);
insert(conn,'target_selection',{'no_klPred','t1','t2','t3','total_input'},{aa,chosenKlPred(aa,1),chosenKlPred(aa,2),chosenKlPred(aa,3),jmlMkInputMerged(chosenIdxKlPred(1,aa),1)});
end

maybe this running out of memory problem is caused by so much 'for' codes there, anyone can help my problem?
thanks before ^^
From: Rune Allnor on
On 15 Sep, 05:22, "husnul khotimah" <uus_1...(a)yahoo.com> wrote:
> hi again,
> i have some problems with my codes, i need to store d array into a mySQL database, but it has these error messages :
>
> ??? No constructor 'com.mathworks.toolbox.database.sqlExec' with matching signature found.
....
> ive read that it's caused by a running out of a memory,

That's an extremely poorly phrased error message, if the
cause of the error is memory issues. Are you *sure* memory
issues are the problem?

....
> maybe this running out of memory problem is caused by so much 'for' codes there, anyone can help my problem?

No. If memory is indeed the problem - but I find it hard to
believe, after having read the error message - then break up
the data, and import/process it in batches. It's a simple fix.

Rune