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
<database name="mydb" engine="oracle">
<jndi name="java:comp/env/jdbc/mydb" />
<mapping href="" />
</database>
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 <database> 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
- [castor-dev] jdo.getDatabaseName() call? Emir Causevic
- [castor-dev] Re: jdo.getDatabaseName() call? Werner Guttmann
- [castor-dev] Re: jdo.getDatabaseName() call? Emir Causevic
- Re: [castor-dev] Re: jdo.getDatabaseName() ca... Werner Guttmann
- [castor-dev] Re: jdo.getDatabaseName() ca... Emir Causevic
