This content has been marked as final. Show 3 replies
user13005878 wrote:That reads like "your datasource configuration is not good, fix it"
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
And I had search from network, and found it said "the ODBC source was run by different server", one was C:\Windows\SysWOW64\odbcad32.exe for 32-bit and c:\windows\system32\odbcad32.exe for 64-bit.It would make a whole lot of sense if that was the other way around, don't you think? SysWOW64 for 64 bits and system32 for 32 bits.
So the question is, why IDE cannot connect to MS Access DBBecause something is wrong
How to set NetBeans IDE to make it connectable to 32 bits or 64 bits ODBC, like the program run without IDE?By setting the correct connection configuration properties.
I'm not 100% positive, but I believe that doing ODBC connections from a 64 bits environment is not actually supported in Java. You may be outraged by that - in Java 8 the ODBC-JDBC bridge is going to be completely dropped, no more connecting to Access from Java without third party libraries (which tend to be commercial). In any case for now try to use a 32 bits Java runtime if you're using a 64 bits one.
Thank your answer!
The problem was that running the JAR (in project/dist/myprogram.jar) which build by NetBeans IDE can connect to MS Access DB, but failed to connect DB if I clicked the menu item "Run Main Project" in IDE environment.
Now each time I have to build the project, and then open the dist folder, and run the jar file, I cannot debug my project via IDE or run it in NetBeans IDE.
thank your answer!
The problem was that when I click the "Run Main Project" or "F6" on NetBeans IDE, the IDE complained about the above error, but if I run the generated distribution JAR (in project/dist/myproject.jar), it's Ok to connect MS Access, so it's my question, I cannot run or debug it in IDE environment, I have to enter the dist folder each time, and run it to check the result.