Joseph and others,
I finally got some time and cleaned up the tutorials to be up to date with
the latest Cayenne code. Now tutorial code is closer integrated with
Cayenne build process, so the problems we had with Alpha 3 should not
happen in the future.
If anyone still has problems with tutorials, I recommend downloading the
nightly build (starting from October 3 or newer - should happen in a few
hours from now), and use code and documentation included with it. When we
do another release, this will become "official".
Cheers.
Andrus
At 12:53 AM 9/16/2002 -0400, Joseph Rajkumar wrote:
>Hi Folks
>
> Thanks to the folks on this mailing list, I got the
>cayenne-web-app to work fine using MySql. Please
>not in this cayennd-web-app if the name of the Painter
>is a single string, it works, but "Molly Brown" does not work
>cayenne-web-app/addPainting.do?name=Brown == works fine
>cayenne-web-app/addPainting.do?name=Molly Brown == does not work.
>
>Then I started playing around with the cayenne-cmd-app.
>
>I got it work fine as distributed, but when I wanted to add the
>date of birth for the artist, I get all kinds of exceptions.
>
>
>import java.sql.Date;
>
>// create new Artist object
> Artist dali = (Artist)ctxt.createAndRegisterNewObject("Artist");
> dali.setArtistName("Salvador Dali");
> dali.setDateOfBirth(new java.sql.Date((long) 19900225));
>
>Add the above to Main.java and run it, you will get lots of messages.
>
>PS: I am using alpha3-1, jdk-1.4.0_01, on Sun Solaris5.8 on a Ultra-2
>
>Regards
>Joseph Rajkumar
>
>Screen print (Partial)
>
>ERROR QueryLogger: --- will run 2 queries.
>ERROR QueryLogger: INSERT INTO .ARTIST (ARTIST_ID, DATE_OF_BIRTH,
>ARTIST_NAME) VALUES (?, ?, ?) [params: 480, '1970-01-01', 'Salvador
>Dali'] - prepared in 1 ms.
>ERROR QueryLogger: *** error.
>java.sql.SQLException: Cannot convert class java.sql.Date to SQL type
>requested
> at org.gjt.mm.mysql.PreparedStatement.setObject(Unknown Source)
> at
>org.objectstyle.cayenne.access.trans.QueryAssembler.initStatement(QueryAssembler.java:168)
>
> at
>org.objectstyle.cayenne.access.trans.QueryAssembler.createStatement(QueryAssembler.java:134)
>
> at
>org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:273)
>
> at
>org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.java:361)
>
> at
>org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:646)
>
> at test.Main.addArtist(Main.java:102)
> at test.Main.runTutorial(Main.java:41)
> at test.Main.main(Main.java:31)
This archive was generated by hypermail 2.0.0 : Thu Oct 03 2002 - 00:34:35 EDT