Robert Pieper wrote:
>
> I'm trying to get a connection to a database with the following code;
>
> try
> {
> Mapping mapping = new Mapping( getClass().getClassLoader() );
> mapping.loadMapping( getClass().getResource( "mapping.xml" ) );
>
> JDO jdo = new JDO();
> jdo.setDatabaseName( "mydb" );
> jdo.setConfiguration( getClass().getResource( "database.xml" ).toString() );
>
> // Test to see if we can get Database object
> jdo.getDatabase();
> }
> catch ( Exception e )
> {
> e.printStackTrace();
> }
>
> Where I call jdo.getDatabase() I get;
>
> MappingException: must call loadMapping first
You must assign the jdo.getDatabase() call to an object of type
org.exolab.castor.jdo.Database in order to make calls via the connection
to the physical database. The view should be no problem.
--
+------------------------------+
| Bruce Snyder |
| [EMAIL PROTECTED] |
+------------------------------+
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev