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".