Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access v7.1
  HXTT Cobol v5.0
  HXTT DBF v7.1
  HXTT Excel v6.1
 
  Buy Now
  Support
  Download
  Document
  FAQ
  HXTT Json v1.0
  HXTT Paradox v7.1
  HXTT PDF v2.0
  HXTT Text(CSV) v7.1
  HXTT Word v1.1
  HXTT XML v4.0
Offshore Outsourcing
Free Resources
  Firewall Tunneling
  Search Indexing Robot
  Conditional Compilation
  Password Recovery for MS Access
  Password Recovery for Corel Paradox
  Checksum Tool for MD5
  Character Set Converter
  Pyramid - Poker of ZYH
   
   
   
Heng Xing Tian Tai Lab of Xi'an City (abbr, HXTT)

HXTT Excel
Strange column types in ResultSetMetadata
Andrew Clark
2015-05-12 16:09:14
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).






Re:Strange column types in ResultSetMetadata
HXTT Support
2015-05-12 18:19:08
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
Re:Re:Strange column types in ResultSetMetadata
Andrew Clark
2015-05-12 21:29:04
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)
Re:Re:Re:Strange column types in ResultSetMetadata
HXTT Support
2015-05-13 07:13:34
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.


Re:Re:Re:Re:Strange column types in ResultSetMetadata
Andrew Clark
2015-05-14 06:34:14
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.

Search Key   Search by Last 50 Questions




Google
 

Email: webmaster@hxtt.com
Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Refund | Sitemap