After a great deal of foul language I managed to get the example to run using a MySQL 
database.  Here's what I had to do;

( I already had a MySQL server running but there was no 'test' database )

1. unzipped examples.zip into $CASTOR_HOME (wherever you've installed it - 
c:\opt\castor-0.9.3 in my case)
2. copied mysql_jdbc.jar to the newly created examples/jdo directory
3. lots of problems with classpath settings but this finally worked;

c:\opt\castor-0.9.3\examples;c:\pub\apache\xalan\xalan.jar;c:\pub\exolab\castor\castor.jar;c:\pub\apache\xerces\xerces.jar;c:\pub\sun\j2ee
\j2ee.jar;c:\opt\sybase\jConnect\jconn2.jar;c:\opt\castor-0.9.3\examples\jdo\mysql_jdbc.jar

4. edited example.sh and deleted the line 'CLASSPATH=`echo *.jar | tr ' ' 
':'`:$CLASSPATH:.'
5. 'javac jdo/*.java' to compile
6. edited the jdo/create.sql file and deleted all the 'drop table ....' statements 
7. logged into MySQL and created a database called 'test' then logged out again
8. created all the required tables in test with 'cat create.sql | /c/mysql/bin/mysql 
-u root -pmypassword test'
(Note; my os is NT but I use the Cygwin bash as I prefer Unix - hence the forward 
slashes ;)
9. edited 'database.xml' to the following;

<database name="test" engine="mysql" >

  <driver class-name="org.gjt.mm.mysql.Driver"
          url="jdbc:mysql://localhost:3306/test">
    <param name="user" value="root" />
    <param name="password" value="mypassword" />
  </driver>

  <mapping href="mapping.xml" />

</database>


Finally ran the example from $CASTOR_HOME with ./example.sh jdo
That worked for me, hope it helps

Rob Pieper

-----Original Message-----
From: Will Sargent [mailto:[EMAIL PROTECTED]]
Sent: Friday, 14 September 2001 12:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Object to DB Example required


I have to agree with you that the JDO example doesn't work right.

I refactored the code and kinda sorta got it working.  The code may not work
right, but it's at least easier to read.

Will.

> Hello,
>
> I can't get the jdo.Test example supplied to work at all.
>
> Can anyone recomend an alternative or a suitable tutorial.
>
> Many thanks,

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to