Help Statement

Help Statement

Post by Paul K » Fri, 20 Apr 2007 06:23:41


Hi I wanted to know how MySQL works in java using JConnector.

I was wondering how is the memory used for this matter, speciffically
lets say
I have one and only one statement CCON aand many result sets like
this:
Statement ST;
ResultSet RS1;
ResultSet RS2;
...
ResultSet RSn;

ST = Ccon.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);

RS1 = St.executeQuery
(
a huge SELECT Query 1
);
RS2 = St.executeQuery
(
a huge SELECT
Query 2
);

.... ...
RSn = St.executeQuery
(
a huge SELECT Query n
);

So if I want to retireve all this queries and use them later, does all
te result sets are kept in memory?

what if I finish using RS1 and RS2 and i close them? Does the JVM free
memory when I close this result sets? is there any consideration I can
take here?

Do you know or have some tips to make great queries which are not
memory consuming?

Thanks a lot

Paul.