[jdom-interest] bug fix

Raffaele Sena raff at aromatic.org
Mon Aug 21 14:00:05 PDT 2000


Hi all,

I found a small bug in the ResultSetBuilder class, and I'm not sure if this
is the right place to report it.

Anyway, here it is: if I mark a column as attribute (with the setAsAttribute
method), an exeption is
rised if a row is fetched and that column is empty.

I noticed that if the column was marked as element, a check for an empty
code is performed.
The same test done also in case of an attribute fixes my problem.

Here is a diff agains the current CVS tree:

Index: ResultSetBuilder.java
===================================================================
RCS file:
/home/cvspublic/jdom-contrib/src/java/org/jdom/contrib/input/ResultSetBuilde
r.java,v
retrieving revision 1.2
diff -r1.2 ResultSetBuilder.java
120c120,122
<               entry.addAttribute(name, value);
---
>               if (!rs.wasNull()) {
>                 entry.addAttribute(name, value);
>             }


I also wrote a small test program that can be useful to play with the
ResultSetBuilder. It allows to pass on the command
line the jdbc driver, URL, login info and query for the SQL part, and set
some paramters on the ResultSetBuilder:
name of the root element, name of the row elements, and mark attributes. If
interested I can post it on this list, or
send it to who may need it.

Best regards,

    Raffaele

----------------------------------------------------------------
raff at aromatic.org       (::)       http://www.aromatic.org/~raff
              http://www.aromatic.org/





More information about the jdom-interest mailing list