db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ram <rameshchinn...@gmail.com>
Subject Re: Configure torque for struts
Date Mon, 17 Dec 2007 02:47:09 GMT
Well to be specific, I have configured the torque, generated the sql schema
files and made it to run perfectly. I even tested using it inside  a main
class like this.

 public static void main(String[] args) throws Exception
    {
    String path = "../crm/Torque.properties";

    Torque.init(path);
    Contacts contacts = new Contacts();
    contacts.setFirstname("Ramesh");
    contacts.setLastname("R");
    contacts.setMiddlename("n");
    contacts.save();
    }

But my purpose is to use it in struts. I am using it like this.

public ActionForward execute(ActionMapping mapping, ActionForm form,
        HttpServletRequest request, HttpServletResponse response)
        throws Exception
    {
    String path = "../crm/Torque.properties";

    Torque.init(path);
    Contacts contacts = new Contacts();
    contacts.setFirstname("xyz");
    contacts.setLastname("s");
    contacts.setMiddlename("n");
    contacts.save();
    request.setAttribute("Id", contacts.getPrimaryKey());
    return mapping.findForward("success");
    }
Please guide whether am on a right track.

On Dec 17, 2007 7:54 AM, Alvaro Coronel <alvarocoronel67@yahoo.com> wrote:

> Hi Ramesh. If you can be more specific, it will be a lot easier to help
> you. Tell us what you are trying to do, how you are trying and how it fails.
>
> Best regards,
> Álvaro.
>
>
>
> Ramesh R <rameshchinnu61@gmail.com> wrote: Hi,
>
>
>
> I am using torque for struts application. I am currently finding difficult
> configuring torque. Please guide me in how to do this.
>
>
>
>
>
> Thanks
>
>
>
> Ramesh r
>
>
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals?  Find them fast with Yahoo!
> Search.
>



-- 
cheers !!

ramesh r
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message