开发者

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified - works fine in IDE - not once exported

开发者 https://www.devze.com 2022-12-30 00:17 出处:网络
I am developing a Java app (with ODBC bridge - forgive me - the only paradox driver I have been able to obtain is the Microsoft ODBC driver) which works fine in Eclipse (and NetBeans) - connecting and

I am developing a Java app (with ODBC bridge - forgive me - the only paradox driver I have been able to obtain is the Microsoft ODBC driver) which works fine in Eclipse (and NetBeans) - connecting and obtaining data from an ancient paradox 5.x database. So long as it is run from inside my IDE, it compiles and runs flawlessly.

When I export it to a runnable jar, suddenly [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified occurs.

The jar is being run on the same box as my developing IDE, so I am confused about the cause. It is being run via console from a user account, as per the IDE.

My connection string is jdbc:odbc:Driver={Microsoft Paradox Driver (*.db )};DriverID=538; Fil=Paradox 5.X; DefaultDir=C:\\paradox\\database\\location\\, obtained from connectionstrings.com, and as mentioned before, it works fine when run from the IDE.

The above seems to 'magically' create its own connection, avoiding the setup of开发者_如何学Python a DSN. I am unsure quite how it does, but it works.

The only other thing I can think of that might be pertinent is that my PC is running a 64-bit OS (Windows Server 2008).


Work around obtained - my JRE for developer was 1.6.0_07, while my JRE for O/S was set to 1.6.0_09.

Although I have no idea why one has access to my driver, and the other doesn't - I can set my JRE to the successful one - but I would still like to know why / how the drivers each version supports are different - and how I can make it work on all.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号