I should be done with the tutorial in the next few days.  Hopefully that
will answer your question.  In the meantime, the save() method
eventually calls doInsert() or doUpdate() (depending if the object has
been modified), so its redundant to call the doInsert() yourself.

Check out the tutorial again, I have a lot of it done, if you follow
those configuration tasks I outlined, then you should not have a problem
with your application.  I have been able to run my sample appliaction
(the one that will be included in the tutorial).

If you still can't get it working, feel free to mail me your
build.properties file, Torque.properties file, and your schema and I'd
be happy to take a peek.

Thanks,
Pete

On Tue, Jan 22, 2002 at 02:47:01PM +0100, Stefan Krause wrote:
> Hi,
> 
> yes that's true. I tried to store the object in the way described 
> in the Peers Howto. That didn't work. So I looked in the 
> Base<TableName>Peer.java and the Base<TableName>.java files. 
> The explanation for the method doInsert() was '/**Method to do
> inserts*/'.
> save() is for 'storing the object in the database'. I just wanted to be
> sure 
> not to get the answer: take the save() method or take the doInsert()
> method. 
> 
> Thanks a lot to Pete and Fabian for the instructions and the tutorial!
> 
> Stefan
> 
> 
> 
> 
> Heiko Braun wrote:
> > 
> > Hi,
> > 
> > i dont have a concrete answer, but i was
> > wondering about your code. Isn't it redundent to
> > first call doInsert() manually and afterwards call save()
> > (which then starts the transaction) ?
> > 
> > Hope that helps,
> > 
> > Heiko
> > 
> > On Sat, 19 Jan 2002 19:26:26 +0100
> > Stefan Krause <[EMAIL PROTECTED]> wrote:
> > 
> >   | Hi,
> >   |
> >   | I use torque in the stand-alone version and I try to insert data into a
> >   | database table.
> >   | I use mysql. The peer classes are created. I compiled my test class
> >   | "DBTest" succesfully.
> >   | My database table to insert exists and is called "Contributor".
> >   | Here is the code:
> >   |
> >   | package org.openscience.nmrshiftdb;
> >   |
> >   | public class DBTest
> >   | {
> >   |     public static void main(String args[])
> >   |     {
> >   |             Contributor con = new Contributor();
> >   |             con.setFirstName("name");
> >   |             con.setLastName("name");
> >   |             con.setZipCode(1234);
> >   |             try
> >   |             {
> >   |                     ContributorPeer.doInsert(con);
> >   |                     con.save();
> >   |             }
> >   |             catch (Exception exc)
> >   |             {
> >   |             }
> >   |     }
> >   | }
> >   |
> >   | When I do run I get the following exception:
> >   |
> >   | run:
> >   |      [java] Exception in thread "main"
> >   | java.lang.ExceptionInInitializerError: java.lang.NullPointerException
> >   |      [java] at
> >   | org.apache.torque.util.BasePeer.getMapBuilder(BasePeer.java:1922)
> >   |      [java] at
> >   | 
>org.opensience.nmrshiftdb.BaseContributorPeer.<clinit>(BaseContributorPeer.java:29)
> >   |      [java] at org.opensience.nmrshiftdb.DBTest.main(DBTest.java:36)
> >   |      [java] Java Result: 1
> >   |
> >   | Is it because it can't find the BasePeer class?
> >   | I would be grateful for an advice.
> >   | Thanks in advance.
> >   |
> >   | Stefan
> >   |
> >   | --
> >   | To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> >   | For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> >   |
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

-- 
Peter Kazmier                                 http://www.kazmier.com
PGP Fingerprint   4FE7 8DA3 D0B5 9CAA 69DC  7243 1855 BC2E 4B43 5654

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to