commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: cvs commit: jakarta-commons/beanutils/src/test/org/apache/commons/beanutils DynaResultSetTestCase.java TestResultSet.java TestResultSetMetaData.java
Date Sat, 13 Jul 2002 01:50:03 GMT


On Fri, 12 Jul 2002, Michael A. Smith wrote:

> Date: Fri, 12 Jul 2002 20:46:44 -0500 (CDT)
> From: Michael A. Smith <mas@apache.org>
> Reply-To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> To: Jakarta Commons Developers List <commons-dev@jakarta.apache.org>
> Subject: Re: cvs commit:
>     jakarta-commons/beanutils/src/test/org/apache/commons/beanutils
>     DynaResultSetTestCase.java TestResultSet.java TestResultSetMetaData.java
>
> On 12 Jul 2002 craigmcc@apache.org wrote:
> [snip]
> >   +<pre>
> >   +  Connection conn = ...;
> >   +  Statement stmt = conn.createStatement();
> >   +  ResultSet rs = stmt.executeQuery
> >   +    ("select account_id, name from customers");
> >   +  ResultSetDynaClass rsdc = new ResultSetDynaClass(rs);
> >   +  Iterator rows = (new ResultSetDynaClass(rs)).iterator();
>
> shouldn't that be rsdc.iterator() rather than
> (new ResultSetDynaClass(rs)).iterator() ?
>

Actually, the line that instantiates rsdc is redundant -- I'll go rip it
out.

> >   /**
> >    * <p>Implementation of <code>DynaClass</code> for DynaBeans
that wrap the
> >    * <code>java.sql.Row</code> objects of a <code>java.sql.ResultSet</code>.
> >    * The normal usage pattern is something like:</p>
> >    * <pre>
> >    *   ResultSet rs = ...;
> >    *   ResutSetDynaClass rsdc = new ResultSetDynaClass(rs);
> >    *   Iterator rows = rsdc.iterator();
>
> It's what you used here anyway...  :)
>

Creating the instance separately works also, of course :-)

>
> regards,
> michael
>

Craig


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


Mime
View raw message