Cannot connect to *.dbf file through JDBC drivers

半世苍凉 提交于 2020-01-03 01:58:08


i'm trying to connect to *.dbf (dBase III) file on my Java application, running on a Windows Server 2003 system. I'm encountering this error and I cannot really understand the meaning (sources for seems to be unavailable):

[Microsoft][ODBC dBase driver] '(unknown)' is not a valid path error

This is the code I run on my application:


String database = "jdbc:odbc:DRIVER={Microsoft dBase Driver(*.dbf)};DBQ=D:\\dbNeri\\CARISTAT;";

Connection conn = DriverManager.getConnection(database);

Statement s = conn.createStatement();
String selTable = "SELECT * FROM CARISTAT";

Does it exists a JDBC driver able to connect to dBase files or do I have to import external libraries to do the magic?

Thanks in advance for your help!


Ok guys, I finally found the answer to all my problems.

Without any need to configure a ODBC data source, the mistake in that code was I've targeted directly in my connection string the file name I would like to access. (In the code up here, I removed "\CARISTAT").

Thus the application run easily and with no more JDBC driver error!!

Thanks anyway for your support!


Are you able to set up a DSN for that database (using ODBC Administrator)? Maybe you just don't have the dBase ODBC drivers installed on that server?


Dbase III is a 16-bit product and Windows Server is a 64-bit environment, which is what causes the compatibility issue.

You will have to use dBDOS to use your DOS based dBase to run our dBase applications on 64-bit platforms.

These sites have more information: