Opening a database outside of the BaseX directory

Monday, 21 September 2015 · 3 messages
B
buddyonweb-software21 Sep 2015 17:35 #
OK, I've been working with BaseX for a little while with some great success. But I am now putting some 'glue' code together and I have a simple task that I am struggling with (believe it or not) Having an issue opening up a database (using just the BaseX jar file). I execute XQuery (inside Java program) and I try specifying the path to the database (e.g. /home/somedirectory/basex/data/MyDB). However whenever I use the full path to get the database, it can't find it. I execute the program locally (without the full path) and everything works just fine! I've tried using db:open() and collection(). Any advice - and sorry for such a simple question. I'm sure I am overlooking something both simple and silly. Thanks again
CG
Christian Grün21 Sep 2015 17:39 #
Quoted text · buddyonweb-software · 7 lines
> Having an issue opening up a database (using just the BaseX jar file). I > execute > XQuery (inside Java program) and I try specifying the path to the database > (e.g. /home/somedirectory/basex/data/MyDB). However whenever I use the full > path to get > the database, it can't find it. I execute the program locally (without the > full path) and everything works just fine!
We need more information: How did you specify the database path? Did you assign it to DBPATH, as described in the documentation [1]? A .basex file may simplify your life; if your setting allows it, you can also move your database directory to your Java working directory. Christian [1] http://docs.basex.org/wiki/Configuration
B
buddyonweb-software21 Sep 2015 17:49 #
The DBPATH worked - boy, don't I feel dumb...oops! Thanks so much again!
Quoted text · Christian Grün · 8 lines
On Monday, September 21, 2015 11:39 AM, Christian Grün <christian.gruen at gmail.com> wrote: > Having an issue opening up a database (using just the BaseX jar file). I > execute > XQuery (inside Java program) and I try specifying the path to the database > (e.g. /home/somedirectory/basex/data/MyDB). However whenever I use the full > path to get > the database, it can't find it. I execute the program locally (without the > full path) and everything works just fine!
We need more information: How did you specify the database path? Did you assign it to DBPATH, as described in the documentation [1]? A .basex file may simplify your life; if your setting allows it, you can also move your database directory to your Java working directory. Christian [1] http://docs.basex.org/wiki/Configuration

⚡Generated with XQuery