We're seeing very inconsistent results in the values returned by ResultSetMetadata specifically getPrecision(), getScale() and getColumnType/getColumnTypeName() seem wrong in several circumstances.
In general this is the connection string that we are using:
jdbc:excel://hs0409:3099/c:/tmp/sampleworkbook.xlsx?maxScanRows=10;
For a column that is Formatted:General with this first 10 rows of data:
Fax
030-0076545
(5) 555-3745
(171) 555-6750
0921-12 34 67
0621-08924
88.60.15.32
(91) 555 91 99
91.24.45.41
These values are returned??
getColumnClassName() = java.lang.Object
getColumnTypeName() = JAVA_OBJECT
getScale() = 0
getPrecision() = 0
getColumnType() = 2000
In general, for any column with only what would be considered "numbers" in it e.g. 0-9,+,_,(,) the returned type is JAVA_OBJECT; that seems clearly wrong, this should be CHARACTER (VARCHAR) data on return. This completely stops us from using your driver and we must have some way to return character data in this case (other columns that contain purely character data e.g. A-Z do correctly return as CHAR).
For a column that is Formatted:Numeric with 2 decimal places and the first 10 rows of data:
Order Number
101.00
102.00
103.00
104.00
105.00
106.00
107.00
108.00
109.00
110.00
The values are even more strange:
getColumnClassName() = java.lang.Long
getColumnTypeName() = BIGINT
getPrecision() = 0
getScale() = 0
getColumnType() = -5
getColumnDisplaySize() = 20
This just seems to be a bug, a Long type getPrecision() should be 18 (or 19).
|
In my test, it will return
getColumnTypeName getColumnDisplaySize getPrecision getScale
Fax VARCHAR 14 14 0 //Your get JAVA_OBJECT because your cell should return number or other type. You can send us your sample for check.
Order Number BIGINT 20 0 0//Recur, 0 means unknown,
>a Long type getPrecision() should be 18 (or 19).
For Decimal/Numeric type, getPrecision and getScale is valuable. For int/bigint, getColumnDisplaySize is an esitmated value.
If your cell contains 106.02 (at least one value is not end with .00) then it will detects as
Order Number NUMERIC 6 6 2
|
I sent an email to support containing the .xls file - one note, the JDBC connection string that I sent was wrong it was actually:
jdbc:excel://hs0409:3099/c:/tmp/sampleworkbook.xlsx?maxScanRows=100
(maScanRows was 100, not 10, if that matters)
|
Checked. The empty value of PostalCode and Fax column in Northwind is number value, so that HXTT Excel think it's a mixture column of number and string. Another JAVA_OBJECT column is a mixutre of decimal and double type. Supported in the latest package.
|
Yes, we just downloaded the new version (4.2?) I guess that we were using the 3.0 trial version whose results were inconsistent, we are getting good results now, thank you.
|