commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From george stewart <gstew...@us-south.net>
Subject Re: [dbutils] query with results
Date Fri, 28 Feb 2003 18:57:16 GMT
"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


Mime
View raw message