cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject RE: Fixes for SQL processor - Patches Attached
Date Fri, 04 Feb 2000 05:19:29 GMT
On Fri, 4 Feb 2000, Stevenson, Chris (SSABSA) wrote:

> > > 2. The SQLProcessor reads a column as a String and then
> > > calls the ColumnFormatter which re-reads the same value.
> > > Well it tries to. JDK1.2.2 coredumps :-)
> 
> > I just provided a rough solution for this issue (2). 
> > Refinements are welcome
> 
> There are still problems with this code - namely, in
> ColumnFormatter.addColumnNode, if format!=null, then
> the resultSet will be read again, causing the error.

Duh....

> I have attached a patches to fix them.

I love this guy. Patched and thanks again.

> Discussion:
> 
> I think the only real solution is to read the value 
> *as an object* in SQLProcessor and then pass this 
> object to the ColumnFormatter like so:
> 
[ ... code snipped ... ]
> 
> This also lets the SQL Driver perform the appriopriate 
> transforms, which is crucial for dates. If you read it 
> as a string you have to hope that the driver has returned
> a properly localised string - a very shaky assumption
> in my experience - convert it to a Date and then back to a 
> String. Better to test for a date and error if
> you have something else...
> 
> Note that we could dispense with the if column.type="Date" 
> tests and 

and... what, test the object to see if it's a java.sql.Date, Time, or
Timestamp?

- donald


Mime
View raw message