You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Steven Caswell <st...@caswell.name> on 2003/03/09 18:07:38 UTC

[dbutils] propose adding getResultSetMetaData to DbUtils.ResultSetHandler

As the subject says, I'd like to modify DbUtils.ResultSetHandler to add a
getResultSetMetaData operation. This would provide a callback to allow an
application using DbUtils.execute to get the column descriptions from the
handler. Proposed signature:

public ResultSetMetaData getResultSetMetaData();


Steven Caswell
steven@caswell.name
"In our own native land, in defense of the freedom that is our birthright,
and which we ever enjoyed till the late violation of it -- for the
protection of our property, acquired solely by the honest industry of our
fore-fathers and ourselves, against violence actually offered, we have taken
up arms. We shall lay them down when hostilities shall cease on the part of
the aggressors, and all danger of their being renewed shall be removed, and
not before." - Thomas Jefferson 



Re: [dbutils] propose adding getResultSetMetaData to DbUtils.ResultSetHandler

Posted by Juozas Baliuka <ba...@centras.lt>.
I do not likemore than one method in callback interface and RSMD is
invalidated after close (possible it is not true on some driver
implementation).
It is usefull to have RSMD after "handle", but I prefer to find some better
solution to retrieve it.

----- Original Message -----
From: "Steven Caswell" <st...@caswell.name>
To: "'Juozas Baliuka'" <ba...@centras.lt>; "'Jakarta Commons Developers
List'" <co...@jakarta.apache.org>
Sent: Monday, March 10, 2003 1:51 AM
Subject: RE: [dbutils] propose adding getResultSetMetaData to
DbUtils.ResultSetHandler


But that would be up to the class implementing ResultSetHandler. Having the
operation in the interface would simply allow a caller to get an instance of
some ResultSetMetaData, however the implementing class handler choses to
provide it. In the test I wrote, I had the implementing class grab the RSMD
instance from the RS as the first thing done in the handle method, and the
instance of RSMD returned by the RS was intact after the RS was closed.


Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."


> -----Original Message-----
> From: Juozas Baliuka [mailto:baliuka@centras.lt]
> Sent: Sunday, March 09, 2003 5:25 PM
> To: Jakarta Commons Developers List; steven@caswell.name
> Subject: Re: [dbutils] propose adding getResultSetMetaData to
> DbUtils.ResultSetHandler
>
>
> I am not sure it will work on closed resultsetm, It is better
> to return custom metadata object and value as result from
> handler. I have changed "handle" signature it will have
> "params" from prepared statement.
>
> ----- Original Message -----
> From: "Steven Caswell" <st...@caswell.name>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Sunday, March 09, 2003 7:07 PM
> Subject: [dbutils] propose adding getResultSetMetaData to
> DbUtils.ResultSetHandler
>
>
> As the subject says, I'd like to modify
> DbUtils.ResultSetHandler to add a getResultSetMetaData
> operation. This would provide a callback to allow an
> application using DbUtils.execute to get the column
> descriptions from the handler. Proposed signature:
>
> public ResultSetMetaData getResultSetMetaData();
>
>
> Steven Caswell
> steven@caswell.name
> "In our own native land, in defense of the freedom that is
> our birthright, and which we ever enjoyed till the late
> violation of it -- for the protection of our property,
> acquired solely by the honest industry of our fore-fathers
> and ourselves, against violence actually offered, we have
> taken up arms. We shall lay them down when hostilities shall
> cease on the part of the aggressors, and all danger of their
> being renewed shall be removed, and not before." - Thomas Jefferson
>
>
>
>
>
>




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


RE: [dbutils] propose adding getResultSetMetaData to DbUtils.ResultSetHandler

Posted by Steven Caswell <st...@caswell.name>.
But that would be up to the class implementing ResultSetHandler. Having the
operation in the interface would simply allow a caller to get an instance of
some ResultSetMetaData, however the implementing class handler choses to
provide it. In the test I wrote, I had the implementing class grab the RSMD
instance from the RS as the first thing done in the handle method, and the
instance of RSMD returned by the RS was intact after the RS was closed.


Steven Caswell
steven@caswell.name
a.k.a Mungo Knotwise of Michel Delving
"One ring to rule them all, one ring to find them..."


> -----Original Message-----
> From: Juozas Baliuka [mailto:baliuka@centras.lt] 
> Sent: Sunday, March 09, 2003 5:25 PM
> To: Jakarta Commons Developers List; steven@caswell.name
> Subject: Re: [dbutils] propose adding getResultSetMetaData to 
> DbUtils.ResultSetHandler
> 
> 
> I am not sure it will work on closed resultsetm, It is better 
> to return custom metadata object and value as result from 
> handler. I have changed "handle" signature it will have 
> "params" from prepared statement.
> 
> ----- Original Message -----
> From: "Steven Caswell" <st...@caswell.name>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Sunday, March 09, 2003 7:07 PM
> Subject: [dbutils] propose adding getResultSetMetaData to 
> DbUtils.ResultSetHandler
> 
> 
> As the subject says, I'd like to modify 
> DbUtils.ResultSetHandler to add a getResultSetMetaData 
> operation. This would provide a callback to allow an 
> application using DbUtils.execute to get the column 
> descriptions from the handler. Proposed signature:
> 
> public ResultSetMetaData getResultSetMetaData();
> 
> 
> Steven Caswell
> steven@caswell.name
> "In our own native land, in defense of the freedom that is 
> our birthright, and which we ever enjoyed till the late 
> violation of it -- for the protection of our property, 
> acquired solely by the honest industry of our fore-fathers 
> and ourselves, against violence actually offered, we have 
> taken up arms. We shall lay them down when hostilities shall 
> cease on the part of the aggressors, and all danger of their 
> being renewed shall be removed, and not before." - Thomas Jefferson
> 
> 
> 
> 
> 
> 



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


Re: [dbutils] propose adding getResultSetMetaData to DbUtils.ResultSetHandler

Posted by Juozas Baliuka <ba...@centras.lt>.
I am not sure it will work on closed resultsetm, It is better to return
custom metadata object and value as result from
handler.
I have changed "handle" signature it will have "params" from prepared
statement.

----- Original Message -----
From: "Steven Caswell" <st...@caswell.name>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Sunday, March 09, 2003 7:07 PM
Subject: [dbutils] propose adding getResultSetMetaData to
DbUtils.ResultSetHandler


As the subject says, I'd like to modify DbUtils.ResultSetHandler to add a
getResultSetMetaData operation. This would provide a callback to allow an
application using DbUtils.execute to get the column descriptions from the
handler. Proposed signature:

public ResultSetMetaData getResultSetMetaData();


Steven Caswell
steven@caswell.name
"In our own native land, in defense of the freedom that is our birthright,
and which we ever enjoyed till the late violation of it -- for the
protection of our property, acquired solely by the honest industry of our
fore-fathers and ourselves, against violence actually offered, we have taken
up arms. We shall lay them down when hostilities shall cease on the part of
the aggressors, and all danger of their being renewed shall be removed, and
not before." - Thomas Jefferson






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