<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE>new patch for org.jdom.contrib.ResultSetBuilder</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>After posting this change request I received several emails suggesting furthur </FONT>
<BR><FONT SIZE=2>changes to aid in a performance boost.</FONT>
</P>

<P><FONT SIZE=2>Damian Van Dooren gets the credit for this idea for furthur performance</FONT>
<BR><FONT SIZE=2>enhancement.</FONT>
</P>

<P><FONT SIZE=2>Note that the original resulted in a 77% increase in speed for the builder</FONT>
<BR><FONT SIZE=2>and the new one results in an 84% increase in speed for the builder.&nbsp; As</FONT>
<BR><FONT SIZE=2>always there are many factors that go into the performance monitoring but</FONT>
<BR><FONT SIZE=2>22 seconds to 3.5 seconds is quite noticable.</FONT>
</P>

<P><FONT SIZE=2>Please incorporate the changes once you get a chance to test them. =)</FONT>
</P>

<P><FONT SIZE=2>CVS Information for ResultSetBuilder that this diff modifies</FONT>
<BR><FONT SIZE=2>===================================================================</FONT>
<BR><FONT SIZE=2>File: ResultSetBuilder.java&nbsp;&nbsp;&nbsp;&nbsp; Status: Up-to-date</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp; Working revision:&nbsp;&nbsp;&nbsp; 1.3</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Repository revision: 1.3&nbsp;&nbsp;&nbsp;&nbsp; /home/cvspublic/jdom-contrib/src/java/org/jdom/co</FONT>
<BR><FONT SIZE=2>ntrib/input/ResultSetBuilder.java,v</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Sticky Tag:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (none)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Sticky Date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (none)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; Sticky Options:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (none)</FONT>
</P>
<BR>
<BR>

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

<P><FONT SIZE=2>David Bartle</FONT>
<BR><FONT SIZE=2>Developer</FONT>
<BR><FONT SIZE=2>Whats Hot Now (whn.com)</FONT>
<BR><FONT SIZE=2>david.bartle@whn.com</FONT>
<BR><FONT SIZE=2>(310) 754-2685 </FONT>
</P>

</BODY>
</HTML>