commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "vccarvalho" <>
Subject DynaBeans and ResultSetDynaClass
Date Fri, 13 Aug 2004 11:52:22 GMT
 Hi there! I'm using dynabeans and resultSetDynaClass to
retreive a resultset from a database. As the sources of
this classes are very rare, I got my self into a
problem. Here's some line of code:

        ResultSetDynaClass rsdc = new
        DynaProperty properties[] =
        BasicDynaClass bdc = new
BasicDynaClass("dynaBean", BasicDynaBean.class, properties);
        Iterator it = rsdc.iterator();
        try {
            while (it.hasNext()) {
                DynaBean row = (DynaBean);
                DynaBean rowCopy = bdc.newInstance();
                PropertyUtils.copyProperties(row, rowCopy);

The SQL statement is the following : "SELECT id_forum,
theme, status FROM forum".

And then I try to use this in this way:

Collection cll = queryRunner.executeDynaQuery(query,
            Iterator it = cll.iterator();
                DynaBean forum = (DynaBean);

But I'm getting a null pointer exception. When I debug,
I noticed that the collection comes with all results
expected (in numbers). The Hashtable inside the object
do have the properties (theme, id_forum and so on) but
they all have null values.
Any ideas????

Thanks a lot

Vinicius Carvalho
Acabe com aquelas janelinhas que pulam na sua tela.
AntiPop-up UOL - É grátis!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message