I have a program that, when compiling using a 32-bit JVM, works fine, but has problems if I try to use a 64-bit JVM. The message I get: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified".
I am trying to connect to Excel and SQL Server databases using the following code:
String file = directory + "/fileName.xlsm";
String connectStr= "jdbc:odbc:DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DBQ=" + file + ";READONLY=false";
try {
Class.forName(getDriver());
gConnection = DriverManager.getConnection(connectStr);
}
When I tried to check the Driver Manager, it did not have a 64-bit version of the drivers. Any way to fix this is easy and be able to connect using 64-bit drivers without manually changing the settings on the computer (since this program will be distributed on several computers, and I donβt want to download the driver separately forever, the computer that wants to run it) ? Also, is it possible to connect more efficiently using 64-bit drivers or 32-bit drivers as good / fast (I have very large datasets, so small differences can make a difference)?
source
share