I am trying to migrate a Servoy application from Servoy 3.1 to 3.5.10 and I found an odd behaviour in the stack Servoy-jTDS-iAnywhere-Excel.
The application in production is actually accessing a couple of tables stored within an Excel workbook on different worksheets.
Fields of type General are managed differently from the 3.5 stack compared to 3.1 stack.
Servoy 3.1:
- Excel cell: type: General
- iAnywhere field: DataType: varchar(510)
- jTDS translation: varchar > varchar
- Servoy dataprovider datatype: TEXT(510)
Everything is working fine in production with this stack.
Servoy 3.5:
- Excel cell: type: General
- iAnywhere field: DataType: nvarchar(255)
- jTDS translation: nvarchar > varchar
- Servoy dataprovider datatype: Unknown
Original database in iAnywhere9 was created with: charset: UTF8, collation, UTF8, char sensitivity: ignore
Newer database in iAnywhere10 was created with: charset: UTF8, collation: UTF8BIN, char sensitivity: ignore
NCHAR charset: UTF8, NCHAR collation: UCA, NCHAR char sensitivity: ignore
Full stack versions for Servoy 3.5:
- Excel 2003
- iAnywhere 10.0.1.3877
- jTDS driver v1.1 (Servoy is not using latest jTDS version (1.2.2) but it is still shipping/updating on jTDS 1.1 also on Servoy4)
- Servoy 3.5.10
My definition for jTDS connection in Servoy is identical to the one used in the Servoy example database, excluding database name and port number:
jdbc:sybase:Tds:localhost:2636?ServiceName=holding_firm_pricing_data&CHARSET=utf8
Being a dataprovider of type unknown Servoy is exposing to my application the physical content of the field (something weird like B@aktyzc) instead of the actual string recorded into the database (Forw=SI). Doing a query with iSQL it showing correct data so the Excel gateway is properly working. It seems something is going wrong into jTDS driver, because it should translate from nvarchar to varchar.
I looked into jTDS documentation looking for datatype mapping at: http://jtds.sourceforge.net/typemap.html and found confirmation that nvarchar should be translated to varchar. I tried also to look into jTDS changelog at: http://jtds.cvs.sourceforge.net/jtds/jtds/CHANGELOG to understand if documentation for newer versions of the driver was reporting something about nvarchar but with no success.
Am I missing something in the jTDS or connection configuration ?
Is someone seeing any possibile workaround ?
Servoy has any particular reason not to use/distribute latest jTDS driver v1.2.x ?
Grazie,
Gianni