#78 BigDecimal type from database throws exception

open
nobody
None
5
2010-08-18
2010-08-18
dawald79
No

prefuse version: beta 2007.20.21
mysqlServer version: 5.1.49

I connect to a mysql database and execute the following query

'SELECT searchTerm, AVG(cost) as average, STD(cost)
FROM table
WHERE cost > 0
GROUP BY searchTerm'

to get a prefuse Table.
It throws a data Exception error : saying "Double type not supported"

I verified that double was not the issue but the AVG(cost) field is actually of type BigDecimal.
So when the table is being built, the schema for that field is set to BigDecimal.class in Type getDataType(...)
but when the value is inserted, the switch(Type) sets that table (row,column) to getDouble which I think is what is throwing the exception.
So to get it to work, in the getDataType function (DefaultSQLHandler) I changed the return type to double.class for the type BigDecimal

Discussion