commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geeta Ramani" <gram...@terralink.com>
Subject RE: [DbUtils] ClassCastException
Date Tue, 22 Jun 2004 18:53:29 GMT
Hi Jim:

Am jumping in here since I ahve not been paying attention to this thread.. But here's an answer
to one of your questions:

Object.getClass() gives the Class object to which your object belongs. For example, Object.getClass().getName()
will give you the name of the class.. etc..(since you say you are new to java, i may suggest
that you look at the api..)

Regards,
Geeta

> -----Original Message-----
> From: Anderson, James H [IT] [mailto:james.h.anderson@citigroup.com]
> Sent: Tuesday, June 22, 2004 2:29 PM
> To: Jakarta Commons Users List
> Subject: RE: [DbUtils] ClassCastException
> 
> 
> Hi David,
> 
> 
> your suggestion with the debugger until tomorrow. I'm still a 
> little new to java, so let me ask you this. Clearly the 
> result being returned by query() is not a List and hence the 
> ClassCastException, but how can I determine at runtime what 
> type of object it is? Must I do a bunch of instanceof tests, 
> or is there a cleaner way?
> 
> Thanks,
> 
> jim
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message