-1

I trying to get data from ms access database stored in Azure File Storage. I set right path to storage, but when I try to get data from base I got this error.My application work fine when ms access database is on my machine.

This is my code:

Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
connection = DriverManager.getConnection("jdbc:ucanaccess:http://example/example/example/Database.accdb");

When I change the url I get error

net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.2 given file does not exist:.

Triso
  • 35
  • 9
  • 1
    Provide code and the full exception stacktrace. By the looks of it you either don't have the driver on the classpath, or you provide an invalid url (eg just `jdbc:ucanaccess:` without a file name. – Mark Rotteveel Jun 09 '17 at 14:02
  • @Marko Could you talk about you want to get access data from where? Such as your local machine, an Azure VM, or others. – Peter Pan Jun 12 '17 at 08:29
  • @Marko Yes, I knew. Just I need to know where your code ran, and whether you configured Azure File Storage to your machine for running code as a NFS. – Peter Pan Jun 12 '17 at 11:55

1 Answers1

1

I downloaded the zip file of UCanAccess source code and viewed it, it seems not to be the ability to connect the access database file via network protocols like HTTP, besides via the url of local filesystem like //c:/... on Windows or ///path/... on Unix-like OS.

So for implementing your needs, there are two solutions as below.

  1. First download the access database file you need to the running environment, then to use it and to back it up to Azure File Storage.
  2. Recommended. Follow the Azure offical tutorial for Windows or Linux to create a file share, and mount the file share using SMB protocol as a local filesystem on your OS, then to use your access file like a local file.

Hope it helps.

Peter Pan
  • 23,476
  • 4
  • 25
  • 43