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 : Mon Sep 16 2002 - 00:59:13 EDT