Using Windows 10. Environment variables set to (with appropriate paths) -
ucanaccess-4.0.2.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
hsqldb.jar
jackcess-2.1.6.jar
Program has run previously using other folders.
Call instructions are -
String strDBName = "jdbc:ucanaccess://c:/WillPgms/Family Genealogy.accdb";
DAO_Conn = DriverManager.getConnection(strDBName);
DAO_Indiv = DAO_Conn.createStatement();
}
catch (Exception e)
{
System.out.println("Indiv: Failed to get DB connection");
}
And I get the error "Failed to get DB connection".
I have checked and the Family Genealogy.accdb is in that directory.
What have I missed? Do the .jar's have to be in the same folder?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Haven't been able to get printStackTrace() to go to file during execute - it stays in DOS window.
Anyway, the error is "java,sql.Exception: No suitable driver found for jdbc:ucanaccess ... db-name..."
The program statement referenced is DAO_Conn = DriverManager.getConnection(strDBName);
JPG of DOS window attached.
Let me know if you need more...
SOLVED! I went back and double-checked all entries.
I had moved the UCanAccess modules to another folder and the Environment Variables pointed to the wrong folder. Thus: "No suitable driver found" error.
Thanks for your help. I learn something new every day.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
java.sql.SQLException: No suitable driver found for jdbc:ucanaccess://C:/Users/Public/UCanAccessTest.accdb
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at PrgTrXSt.main(PrgTrXSt.java:6)
Using Windows 10. Environment variables set to (with appropriate paths) -
ucanaccess-4.0.2.jar
commons-lang-2.6.jar
commons-logging-1.1.1.jar
hsqldb.jar
jackcess-2.1.6.jar
Program has run previously using other folders.
Call instructions are -
String strDBName = "jdbc:ucanaccess://c:/WillPgms/Family Genealogy.accdb";
DAO_Conn = DriverManager.getConnection(strDBName);
DAO_Indiv = DAO_Conn.createStatement();
}
catch (Exception e)
{
System.out.println("Indiv: Failed to get DB connection");
}
And I get the error "Failed to get DB connection".
I have checked and the Family Genealogy.accdb is in that directory.
What have I missed? Do the .jar's have to be in the same folder?
Please use
e.printStackTrace
to capture the actual error message with context and post it here.Thx, Gord. Will do. (pun?)
Haven't been able to get printStackTrace() to go to file during execute - it stays in DOS window.
Anyway, the error is "java,sql.Exception: No suitable driver found for jdbc:ucanaccess ... db-name..."
The program statement referenced is DAO_Conn = DriverManager.getConnection(strDBName);
JPG of DOS window attached.
Let me know if you need more...
SOLVED! I went back and double-checked all entries.
I had moved the UCanAccess modules to another folder and the Environment Variables pointed to the wrong folder. Thus: "No suitable driver found" error.
Thanks for your help. I learn something new every day.
The UCanAccess driver jar file is not on the classpath. I have unpacked the bin.zip to
C:\Users\Public\Downloads\UCanAccess
so my jar file paths areSo, if I try to simply run
java PrgTrXSt
I getHowever, this works: