Emir,

I think what the authors had in mind originally is allowing to configure more than one database engine in the config file and during initialization of a JDO instance specify which one to use. But I could be wrong with this.

Regards
Werner

--Original Message Text---
From: Emir Causevic
Date: Thu, 18 Mar 2004 17:38:49 GMT

Hi Werner,
I was just asking if there's some explanation behind that approach.
Simply, why shouldn't the database name be read from the config file and set as appropriate?
But, nevermind I'll just take it as it is.

Thank you for your help.
Regards,
Emir

Werner Guttmann writes:

> Emir,
>
> as stated in the API docs for JDO.java at
>
> http://castor.exolab.org/api/org/exolab/castor/jdo/JDO.html
>
> when instantiating Castor JDO, you have to provide a valid database name, either via the constructor as per
>
> http://castor.exolab.org/api/org/exolab/castor/jdo/JDO.html#JDO(java.lang.String)
>
> or via
>
> http://castor.exolab.org/api/org/exolab/castor/jdo/JDO.html#setDatabaseName(java.lang.String)
>
> Iow, setting a database name is required before you can make use of Castor.
>
> Note: Please make sure that the name used is identical with the name used your config file, e.g. using a config file similar to
>
>
>
>
>
>
> should result into a call to either
>
> JDO jdo = new JDO ("mydb");
>
> or
>
> JDO jdo = new JDO();
> ...
> jdo.setDatabaseName("mydb");
>
> I hope this helps.
> Werner
>
> --Original Message Text---
> From: Emir Causevic
> Date: Thu, 18 Mar 2004 15:57:11 GMT
>
> Hi all,
> can someone please explain me or point me to the API documentation regarding the call to
> getDatabaseName() before setting it with setDatabaseName().
> I'm a beginner with Castor and just wondering why can't the database name be read from the database
> XML config file?
> It appears as attribute in tag, isn't it?
> Or those names doesn't refer to the same thing?
>
> I've tried to create JDO object, loadConfiguration() from XML file and then call getDatabaseName() to
> retrieve the database name. I got an excpetion saying that I need to setDatabaseName() prior to calling
> getDatabaseName(). That seems obvious, but I think that the load of configuration would retrieve and set
> the database name.
>
> Thank you,
> ec
>
>
>
>
>
> ________________________________
> 15 Mbytes Free Web-based and POP3
> Sign up now: http://www.gawab.com
> ----------------------------------------------------------- If you wish to unsubscribe from this mailing,
> send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
>
>




________________________________
15 Mbytes Free Web-based and POP3
Sign up now: http://www.gawab.com
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev

Reply via email to