hi Charles,

thanx a lot for the suggestion.
Itz working fine now but only problem is itz(cmp) inserting time stamp in
the 26-JUL-00 format to the oracle db.
so i altered the DB session by the following command
ALTER SESSION SET NLS_DATE_FORMAT = 'DD-mm-YYYY hh24:mi:ss';
then itz inserting in 26-07-2000 00:55:34 format.

but i am unable to insert complete timestamp (2000-05-14 19:57:04.155).

what will be the alter session command to insert to the db in the above
format??

Thanx

Purushotham Das

> -----Original Message-----
> From: May Charles N [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, July 25, 2000 7:57 AM
> To:   [EMAIL PROTECTED]
> Subject:      FW: CMP - problem
>
> Although you can use the java call
> new java.sql.Timestamp(System.currentTimeMillis())
> to generate the appropriate timestamp, we've found it better to use Oracle
> triggers on each table (before insert or update, for each row, referencing
> new...) to set this field. That way you don't have to worry about synching
> the clocks of multiple app servers if you intend to use the timestamp for
> optimistic locking.
>
> IBM suggested this approach and gives sample DB2 triggers which you can
> modify for Oracle on page 182 of their redbook SG24-5754-00.
>
> Charles May, Software Engineer
> AFCO Credit Corp. - Pittsburgh Systems Group
> A Mellon Financial Company
>
> > -----Original Message-----
> > From: Purushotham Das K [SMTP:[EMAIL PROTECTED]]
> > Sent: Saturday, July 22, 2000 7:32 AM
> > Subject:      CMP - problem
> >
> > hi all,
> >
> >
> > i am having some problem while inserting records to the Oracle database
> > using cmp bean. I wanna to insert current timestamp for one of the
> columns
> > which is declared as date(in oracle).
> > How CMP field should be declared & How to generate time stamp to achieve
> > above task.
> > if i declare cmp field as date how to generate current timestamp. if
> wanna
> > pass sysdate(oracle......current date) how should i pass this using
> cmp..
> >
> >
> > Thanx
> > Purushotham
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to