Main   Products   Offshore Outsourcing   Customers   Partners   ContactUs  
JDBC Databases
  HXTT Access 7.1.135
  HXTT Cobol 5.0.135
  HXTT DBF 7.1.136
  HXTT Excel 6.1.139
  Buy Now
  HXTT Json 1.0.107
  HXTT Paradox 7.1.135
  HXTT PDF 2.0.135
  HXTT Text(CSV) 7.1.135
  HXTT Word 1.1.135
  HXTT XML 4.0.136
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.0
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:

For a column that is Formatted:General with this first 10 rows of data:
(5) 555-3745

(171) 555-6750
0921-12 34 67
(91) 555 91 99

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

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.0
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.0
I sent an email to support containing the .xls file - one note, the JDBC connection string that I sent was wrong it was actually:


(maScanRows was 100, not 10, if that matters)
Re:Re:Re:Strange column types in ResultSetMetadata
HXTT Support
2015-05-13 07:13:34.0
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.0
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


Copyright © 2003-2019 Heng Xing Tian Tai Lab of Xi'an City. | All Rights Reserved. | Privacy | Legal | Sitemap