[jdom-interest] new patch for org.jdom.contrib.ResultSetBuilder

David Bartle David.Bartle at whn.com
Wed Dec 13 17:36:09 PST 2000


After posting this change request I received several emails suggesting
furthur 
changes to aid in a performance boost.

Damian Van Dooren gets the credit for this idea for furthur performance
enhancement.

Note that the original resulted in a 77% increase in speed for the builder
and the new one results in an 84% increase in speed for the builder.  As
always there are many factors that go into the performance monitoring but
22 seconds to 3.5 seconds is quite noticable.

Please incorporate the changes once you get a chance to test them. =)

CVS Information for ResultSetBuilder that this diff modifies
===================================================================
File: ResultSetBuilder.java     Status: Up-to-date

   Working revision:    1.3
   Repository revision: 1.3
/home/cvspublic/jdom-contrib/src/java/org/jdom/co
ntrib/input/ResultSetBuilder.java,v
   Sticky Tag:          (none)
   Sticky Date:         (none)
   Sticky Options:      (none)



--- Diff ---
112a113,125
> 
>         // get the column labels for this record set
>         String[] columnName = new java.lang.String[colCount];
>         for (int index = 0; index < colCount; index++) {
>           columnName[index] = new String( rsmd.getColumnName(index+1) );
>         }
> 
>         // build the org.jdom.Document out of the result set
>         String name;
>         String value;
>         Element entry;
>         Element child;
>         
114c127
<           Element entry = new Element(rowName, ns);
---
>           entry = new Element(rowName, ns);
116,119c129,137
<             String origName = rsmd.getColumnName(col);
<             String name = lookupName(origName);
<             String value = rs.getString(col);
<             if (isAttribute(origName)) {
---
>             if(names.isEmpty() ) {
>               name = columnName[col-1];
>             }
>             else {
>               name = lookupName( columnName[col-1] );
>             }
> 
>             value = rs.getString(col);
>             if (!attribs.isEmpty() && isAttribute(name)) {
125c143
<               Element child = new Element(name, ns);
---
>               child = new Element(name, ns);
------------


David Bartle
Developer
Whats Hot Now (whn.com)
david.bartle at whn.com
(310) 754-2685 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20001213/bc7651e3/attachment.htm


More information about the jdom-interest mailing list