db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: How to get table info from DynaBeans in Iterator returned in query() or fetch()?
Date Tue, 21 Feb 2006 10:07:00 GMT
On 2/21/06, Vignesh Swaminathan <vswamina@cordys.com> wrote:

> I want to use the Platform.query() method and then get table info
> (SqlDynaClass) from the dynabean contained in the returned Iterator. Is
> this possible? If yes, how do it do it?
> Currently I get a ClassCastException if I try to cast SqlDynaBean for
> DynaBean returned and also an exception is thrown when I try
> Database.getDynaClassFor(DynaBean)

Depending on the database you're working against, DdlUtils may not be
able to determine the table from the result set alone. E.g. PostgreSQL
does not provide enough info for this. This is why there are variants
of the fetch/query methods where you gan give table hints to DdlUtils.
Only if DdlUtils can resolve the table(s) and column(s) in the result,
set, a SqlDynaClass/SqlDynaBean is used, otherwise it is a plain


View raw message