torque.database.default=bookstore

torque.database.bookstore.driver = org.gjt.mm.mysql.Driver
torque.database.bookstore.url = jdbc:mysql://localhost/bookstore
torque.database.bookstore.username =root 
torque.database.bookstore.password =anjenelu

make sure your torque.properties contains the above setting

-----Original Message-----
From: Dinesh [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 01, 2002 1:40 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: getConnection exception

We want to use Torque stand alone. We can generate the object api (so
connection
is obtained and used) but cannot use it..

Following the tutorial page, we get an exception.

thanks for any help. below is the example.
-dinesh

With respect to OM (Object Model) of torque , we are getting the following
error when we execute OM class (org.pantoto.test)

java.sql.SQLException: Connection object is null!
        at
org.apache.torque.pool.DBConnection.getConnection(DBConnection.java,
Compiled Code)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java, Compiled
Code)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java, Compiled
Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.test.main(test.java, Compiled Code)
rethrown as org.apache.torque.TorqueException: Connection object is null!
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java, Compiled
Code)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java, Compiled
Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.om.BasePeoplePeer.doInsert(BasePeoplePeer.java,
Compiled Code)
        at org.pantoto.test.main(test.java, Compiled Code)

In the above class (org.pantoto.test) , i am trying to insert a record

package org.pantoto;

import org.apache.torque.om.*;
import org.apache.torque.*;
import org.apache.torque.pool.*;
import org.pantoto.om.*;

public class test
{
        public static void main(String args[])
        {
                try {
                        Torque.init("Torque.properties");
                        People obj=new People();
                        obj.setPeopleId("1");
                        obj.setName("anil");
                        obj.setSpecies(1);
                        obj.setPlanet(1);
                        PeoplePeer.doInsert(obj);
                }catch(Exception e){ e.printStackTrace(); }
                finally {
                        System.out.println("finally");
                }
        }
}




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

Reply via email to