commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@centras.lt>
Subject Re: [dbutils] query with results
Date Sat, 01 Mar 2003 07:30:48 GMT
ok, we will add this, I was not sure it can be usefull.
Do we need to call "getMoreResults()" before or affter "getResultSet". As I
understand documentation
we must call "getResultSet" first (I have never used it in practice).

----- Original Message -----
From: "george stewart" <gstewart@us-south.net>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Friday, February 28, 2003 8:57 PM
Subject: Re: [dbutils] query with results


> "Juozas Baliuka" <baliuka@centras.lt> writes:
>
> > Do you know some use case for this ?
> >
> > As I understand it must look like this:
> >
> >        ResultSet last = null;
> >         try{
> >              if (pstmt.execute()) {//it can be update or select
> >                  do{
> >                      last = pstmt.getResultSet();
> >                      rsh.handle(last);
> >                  }while(pstmt.getMoreResults()); //closes resultset and
> > retrieves next;
> >              }
> >        }finally{
> >          close(last);
> >      }
> >
> >
>
> One commonly used case is for retrieving a identity for databases which
support that.
>
> For sql server, "SELECT @@identity" would follow you insert statement.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message