How can JDataStore database file names be specified with a relative path specification?

Abstract: How can JDataStore database file names be specified with a relative path specification?

If a JDataStore database is located in /myproject/database/mydatabase.jds and you wanted to have all project
file specifications relative to "/myproject", the following would work:

1) Make sure the JVM "user.dir" system property is set to "/myproject". We use the
java.io.File.getAbsolutePath() method to qualify relative paths. This method
looks at the JVM "user.dir" system property to qualify relative paths.
File.getAbsolutePath() is java's way of dealing with the fact that "current
directory" cannot be set for a JVM process (its inherited from the spawning
process). JBuilder is supposed to set this property to the project directory
when you run or debug your app from JBuilder. You can also override this setting in
the JBuilder project properties VM options on the Run tab.

2) Now you can specify your JDataStore database location relatively as "database/mydatabase.jds".

DS159: How can database log files be relocated when a database is copied or moved to a different location?

If you use JDS 4 or greator and locate log files in the same directory as
the database, you don't have to do anything when you move a database.
Otherwise, you can use the following code to relocate the log files.

DataStore dataStore = new DataStore();
TxManager tm = new TxManager();

tm.setALogDir("c:/db/mydatabase/log"); // Inform JDataStore where the log files now exist.

dataStore.setFileName("c:/db/mydatabase");
dataStore.setUserName("Steve");
dataStore.setTxManager(tm);
dataStore.open();
dataStore.shutdown();