The returned datatype for a SQLServer Date type is returned as a varchar with a length of 10. This is wrong, it should return as Sql.Date.
int iType = rsMeta.getInt("DATA_TYPE");
String tmp = rsMeta.getString("TYPE_NAME");
Duplicate of feature request #78. I'm aware of the problem, but still have no idea how to fix that.
Still faulty in jTDS 1.3.1 ... :-( This is a really bad bug, as generic code gets broken when the datatype changes from datetime to date! Generic code is dependent on correct datatypes. String is the worst type - our workaround is just a guess by parsing the string if it could be a date value.
I don't understand what is so difficult about this? It would be at least much better if you handle Date as Datetime. Much better than string.
jTDS 1.3.1 ... I've fallen foul of this twice recently, once using javax.persistence.AttributeConverter mapping to/from entities with JPA, and secondly in some generic code that was looking at the column type in java.sql.DatabaseMetaData. Both were expecting java.sql.Date and were working fine with other JDBC drivers.
It looks like the MS JDBC driver supports conversion correctly (according to their web site)
Is there any news regarding a fix in jTDS?
I just ran into this same bug in our application. The MS SQL column of type date is returned as a varchar (int=12).
Can we help on solving this?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.