Problem with storing data into Data base

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with storing data into Data base

G.Venkata Phanindra
Hi,
     I am trying to add an entry into one of the table Named OrderHeaderExt
i am writting the following lines of code but the data is not getting stored
into data base.what is that iam doing worng in the following lines of code.
------------------------------------------------------
 String deliveryDate = "22/Sep/2006";
            Date deliveryDateValue = df.parse(deliveryDate);
            Timestamp deliveryDateTimestamp = new Timestamp(
deliveryDateValue.getTime());
            GenericValue orderHeaderExt = delegator.makeValue("OrderHeaderExt",
UtilMisc.toMap("orderId", orderId, "deliveryDate", deliveryDateTimestamp));
            try {
                orderHeaderExt.store();
            } catch (GenericEntityException e) {
                e.printStackTrace();
            }

--
G.Venkata Phanindra
Mob:: 9849852989
Reply | Threaded
Open this post in threaded view
|

Re: Problem with storing data into Data base

cjhowe
orderId is undefined.  If you've defined it elsewhere,
the error should be printed in the log.

--- "G.Venkata Phanindra" <[hidden email]> wrote:

> Hi,
>      I am trying to add an entry into one of the
> table Named OrderHeaderExt
> i am writting the following lines of code but the
> data is not getting stored
> into data base.what is that iam doing worng in the
> following lines of code.
>
------------------------------------------------------

>  String deliveryDate = "22/Sep/2006";
>             Date deliveryDateValue =
> df.parse(deliveryDate);
>             Timestamp deliveryDateTimestamp = new
> Timestamp(
> deliveryDateValue.getTime());
>             GenericValue orderHeaderExt =
> delegator.makeValue("OrderHeaderExt",
> UtilMisc.toMap("orderId", orderId, "deliveryDate",
> deliveryDateTimestamp));
>             try {
>                 orderHeaderExt.store();
>             } catch (GenericEntityException e) {
>                 e.printStackTrace();
>             }
>
> --
> G.Venkata Phanindra
> Mob:: 9849852989
>