Connection a Java Application through ODBC to an Unknown Data Source
I have written a Java application where it should connect to "any" SQL based data source/database through Microsoft's ODBC connection and run SQL queries. I used the native Sun/Oracle JDBC-ODBC bridge to serve this very purpose. However, I don't seem to be getting the right data type for certain/random fields, depending on which database I get connected to. For instance, I get a "1.0" for a field where I should be getting a plane integer "1" and for date fields I get different timestamps which could be entirely different to what is originally set on the data source's tables.
I also know that the JDBC-ODBC driver provided by Sun/Oracle is an experimental driver and I'm guessing that is the cause of my issue.
Please keep in mind that as part of the requirements, everything should go through ODBC connections.
Is there any comprehensive drivers out there that could treat the majority of databases and come up with the right ResultSets in terms of their original types?
If not, how do you think I should get around this situation where I have no clue what database my application is dealing with at each particular occasion?