Re: root_path = configuration
Tobias Downer <[email protected]> Fri, 17 Mar 2006 18:06:10 -0800
| Newsgroups | gmane.comp.db.mckoi |
|---|---|
| Message-ID | <[email protected]> |
Hi,
The 'root_path' property is only used when starting Mckoi through the
command line interface. When using the control API, DefaultDBConfig
needs to be told the path of the Mckoi configuration file if that's the
location you wish the database to be stored at. For example;
File config_path = new File("/absolute/path/of/config/");
File config_file = new File(config_path, "mckoidb.conf");
DefaultDBConfig config = new DefaultDBConfig(config_path);
config.loadFromFile(config_file);
DBController control = DBController.getDefault();
control.createDatabase(config, "someuser", "somepassword").close();
Toby.
Dick Repasky wrote:
> Hi All,
>
> I'm using Mckoi1.0.3 in embedded mode, and I'd like the data directory
> to be relative to the configuration file. But, when I create the
> database, it is the path is relative to the current working directory
> rather than relative to the location of the configuration file. Here is
> what I do.
>
> root_path = configuration
> database_path = ./mckoidb
>
> I do
> File configfile = new File("/absolute/path/of/mckoidb.conf");
> DefaultDBConfig config = MckoiUtils.loadConfig(configfile);
>
> System.out.println(config.getValue("root_path");
> prints configuration, as is should
>
> But, then,
>
> DBController control = DBController.getDefault();
> control.createDatabase(config, "someuser", "somepassword").close();
>
> creates the database in a directory named mckoidb that is relative to
> the current working directory rather than in a directory named mckoidb
> that is relative to the location of the configuration file.
>
> Is this a bug? I searched the mailing list archives for root_path but
> came up with way too many hits on just root or just path and gave up
> before finding an entry that really contained root_path. Ditto for
> "root_path". Also not useful were root_path configuration.
>
> Thanks,
>
> Dick
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]