Avatar of snajalm
 asked on

Connection a Java Application through ODBC to an Unknown Data Source

Dear Experts,

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?

Many Thanks,

Avatar of undefined
Last Comment

8/22/2022 - Mon
Dave Baldwin

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Many Thanks
Your help has saved me hundreds of hours of internet surfing.