Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: JDBC: getMoreResults() versus rs.next() & autoGeneratedKeys Date: Sat, 21 Dec 2013 10:15:18 +0100 Lines: 36 Message-ID: References: <52b4dbf5$0$304$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net wf4HwYl4f78kmRFkF+JM6gxDFPzrGLEbdoQypkrDEM77TQMRo= Cancel-Lock: sha1:CJaT6PZSOq5nbtMgt+XXU0l5dUo= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <52b4dbf5$0$304$14726298@news.sunsite.dk> Xref: csiph.com comp.lang.java.programmer:27006 On 21.12.2013 01:08, Arne Vajh=F8j wrote: > On 12/20/2013 9:07 AM, Andreas Leitgeb wrote: >> I have to write code to execute runtime-specified SQL-statements, >> and there are two things that I wasn't able to understand from reading= >> the javadocs: >> >> 1.) >> When would one call .getMoreResults() on a statement instead of just >> another rs.next() on the first one (obtained from stmnt.getResultSet()= )? >> Are these equivalent, or is there really a concept of multiple >> ResultSets, >> each of which has its own independent set of rows? > > Yes. > > Some databases support stored procedures returning multiple > result sets. That feature is not limited to stored procedures. You can have multiple = statements executed with a single Statement. Consequently you get=20 multiple results. > Note that the different result sets does not need to have same > number of columns or same column types. Exactly. Kind regards robert