I've been trying to connect to an Access DB file (*.accdb) from a platform built on Java. I've uploaded the driver files and all the jar files to what I believe to be the correct location in this platform's file structure. I can access the file if I copy it from across the network to my local machine, but when I try to access the file out on the network from that same machine, it attempts to connect, but fails to find the file which throws the following exceptions:
"Caused by: net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.6 given file does not exist: \xxx\dfs\operations\Capacity.accdb
Caused by: java.io.FileNotFoundException: given file does not exist:
\xxx\dfs\operations\Capacity.accdb
I have the drive mapped to my local machine as O:\ (Win 7). As I understand it, Win Server 2012 uses dfs to spread files around on different servers to conserve space, etc. Does anyone have any experience with the same problem? Thanks.
I've tried a number of different iterations in the connect string, but have not been able to get it to connect.
Wondering about authentication, syntax, and whether the dfs is messing with the namespace too much.
Best,
Dan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried all three of these connection URL's in multiple iterations (slash variations, including "dfs" in the path or not, including the drive letter or not) when the UNC path did not connect:
3) Create a connection using the following JDBC Connection URL examples:
Windows local path:
jdbc:ucanaccess://C:/Users/Public/Database1.accdb;showSchema=true
Windows UNC path: jdbc:ucanaccess:////servername/sharename/foldername/Database1.accdb;showSchema=true
Linux/unix: jdbc:ucanaccess:///home/gord/Documents/Database1.accdb;showSchema=true
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just to be clear Dan,
and because it's one of most frequent questions... if you can access via java to that path, it works. If not, it doesn't. This isn't UCanAccess related.
In other words, if you do
That's very helpful Marco. Thank you for the pointer.
I'm using a java platform that uses Jython as its scripting lanquage. Perhaps I'll do some testing along those lines.
If I find anything revealing, I'll try to remember to post back for posterity.
It does seem like it could be a permissions or authority issue.
Best, Dan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dan - If you find that you can connect using a UNC path that points to the actual server name, but not with a UNC path that points to the DFS alias then you might be up against the issue described here:
Thanks for this clue Gord. I have tried restarting while following the guidelines above, and made some inquiry into my registry, and paths don't appear to be corrupt.
I'm working within a platform that uses Jython as its scripting language, so I've brought some Python tools to bear on the problem and was able to get a different response/exception to an attempt to connnect to the file over dfs, to wit:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'net.ucanaccess.jdbc.UcanaccessDriver' for connect URL 'jdbc:ucanaccess:\\mcv\dfs\operations\capacity.accdb;showSchema=true'
Caused by: java.sql.SQLException: No suitable driver
So I proceeded to plug that string into the jdbc:ucanaccess: URL as indicated in the exception above, and it appears I've hung up the driver somehow. Still not clear if the driver kicks off properly if I would still receive a file not found exception as before, so it's hard to know whether this is "progress" on its face. Any further sleuthing tips are much appreciated when anyone gets a moment. Thanks.
Best,
Dan
Last edit: Dan Drendall 2017-06-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
re: "no suitable driver" - The connection must begin with jdbc:ucanaccess:// and then the path to the database file. For UNC path \\server\share\folder\file.accdb that would be
To be clear regarding the UNC path vs a DFS alias, according to the registry, I'm using the UNC path which involves "./dfs/." in the path at least from my desktop's perspective that's the case. If this is the alias, and there is a UNC path then my IT person is not aware of it, and our IT service that we outsource our servers to has not been forthcoming re: this config internal to their system.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been trying to connect to an Access DB file (*.accdb) from a platform built on Java. I've uploaded the driver files and all the jar files to what I believe to be the correct location in this platform's file structure. I can access the file if I copy it from across the network to my local machine, but when I try to access the file out on the network from that same machine, it attempts to connect, but fails to find the file which throws the following exceptions:
"Caused by: net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::3.0.6 given file does not exist: \xxx\dfs\operations\Capacity.accdb
Caused by: java.io.FileNotFoundException: given file does not exist:
\xxx\dfs\operations\Capacity.accdb
I have the drive mapped to my local machine as O:\ (Win 7). As I understand it, Win Server 2012 uses dfs to spread files around on different servers to conserve space, etc. Does anyone have any experience with the same problem? Thanks.
I've tried a number of different iterations in the connect string, but have not been able to get it to connect.
Wondering about authentication, syntax, and whether the dfs is messing with the namespace too much.
Best,
Dan
I've tried all three of these connection URL's in multiple iterations (slash variations, including "dfs" in the path or not, including the drive letter or not) when the UNC path did not connect:
3) Create a connection using the following JDBC Connection URL examples:
Windows local path:
jdbc:ucanaccess://C:/Users/Public/Database1.accdb;showSchema=true
Windows UNC path: jdbc:ucanaccess:////servername/sharename/foldername/Database1.accdb;showSchema=true
Linux/unix: jdbc:ucanaccess:///home/gord/Documents/Database1.accdb;showSchema=true
Just to be clear Dan,
and because it's one of most frequent questions... if you can access via java to that path, it works. If not, it doesn't. This isn't UCanAccess related.
In other words, if you do
you get the answer.
And you can redirect yourself to the right forums for help.
Cheers Marco
Last edit: Marco Amadei 2017-05-24
That's very helpful Marco. Thank you for the pointer.
I'm using a java platform that uses Jython as its scripting lanquage. Perhaps I'll do some testing along those lines.
If I find anything revealing, I'll try to remember to post back for posterity.
It does seem like it could be a permissions or authority issue.
Best, Dan
Dan - If you find that you can connect using a UNC path that points to the actual server name, but not with a UNC path that points to the DFS alias then you might be up against the issue described here:
http://wiki.sirkit.ca/2012/11/windows-domain-dfs-namespace-access-is-denied-using-domain-fqdn-access-allowed-using-server-unc-paths-directly/
Thanks for this clue Gord. I have tried restarting while following the guidelines above, and made some inquiry into my registry, and paths don't appear to be corrupt.
I'm working within a platform that uses Jython as its scripting language, so I've brought some Python tools to bear on the problem and was able to get a different response/exception to an attempt to connnect to the file over dfs, to wit:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'net.ucanaccess.jdbc.UcanaccessDriver' for connect URL 'jdbc:ucanaccess:\\mcv\dfs\operations\capacity.accdb;showSchema=true'
Caused by: java.sql.SQLException: No suitable driver
In Python I did a:
and the interpreter returned:
So I proceeded to plug that string into the jdbc:ucanaccess: URL as indicated in the exception above, and it appears I've hung up the driver somehow. Still not clear if the driver kicks off properly if I would still receive a file not found exception as before, so it's hard to know whether this is "progress" on its face. Any further sleuthing tips are much appreciated when anyone gets a moment. Thanks.
Best,
Dan
Last edit: Dan Drendall 2017-06-05
re: "no suitable driver" - The connection must begin with
jdbc:ucanaccess://
and then the path to the database file. For UNC path\\server\share\folder\file.accdb
that would beTo be clear regarding the UNC path vs a DFS alias, according to the registry, I'm using the UNC path which involves "./dfs/." in the path at least from my desktop's perspective that's the case. If this is the alias, and there is a UNC path then my IT person is not aware of it, and our IT service that we outsource our servers to has not been forthcoming re: this config internal to their system.
If it helps, I can do the following Python command from within the Java platform with repeatable success:
So I can access the db file via file utilities internally from my java platform.
If possible, please run the following Java test code and let us know what you get.