I realized. The getBroker then getConnection is the way.

Thanks for tips from everyone.


Edson Richter

  ----- Original Message ----- 
  From: Charles Anthony 
  To: 'OJB Users List' 
  Sent: Wednesday, September 10, 2003 3:35 AM
  Subject: RE: How to use DUAL


  Hi Edson,

  You say you're working "client-server" with OJB. Assuming that you do all
  the "persisting" on the server side (i.e. OJB only used on the server), you
  could use a PBListener for  BeforeUpdate/Insert events, and set the datetime
  then (using a java.sql.Date). 

  If you really just want to execute an arbitrary SQL statement (select
  TIMESTAMP from DUAL)
  , that doesn't map to a java class, then the simple answer is No, there is
  no better way to do it. Essentially : get a broker, get the brokers
  connection, create and execute the statement, close everything.

  Cheers,

  Charles.

  >-----Original Message-----
  >From: Edson Carlos Ericksson Richter
  >[mailto:[EMAIL PROTECTED]
  >Sent: 09 September 2003 20:33
  >To: OJB Users List
  >Subject: Re: How to use DUAL
  >
  >
  >About secure messages, you are right. Excuses to mail list users.
  >
  >About using new Date(), this works fine if my app is j2ee based (like
  >JSP, web services and so on), but my app is Swing (by now 
  >client-server)
  >based, and I need to guarantee that workstation (if I use new Date())
  >has date/time correctly set... That isn't what I want.
  >
  >A malicious user could change date/time on workstation between process.
  >I must warranty that I will be using the server date/time so I can be
  >confident about it.
  >
  >Any other tips?
  >
  >I've implemented a call to a procedure, obtaining a connection from a
  >PersistenceBroker... But could be a more "expert" way to do it.
  >
  >Thanks for any tips,
  >
  >Edson Richter
  >
  >
  >
  >Em Seg, 2003-09-08 �s 12:58, Roland Carlsson escreveu:
  >> Hi Edson!
  >> 
  >> The simplest way to do this is to set the date in your 
  >value-object. Eg setMyDate(new Date()); and then store the 
  >object. Since most databases I tested support higher 
  >time-resolutions than whole seconds or in your case (guessing 
  >oracle) 1/10 of a second if I remember correctly it should be 
  >good enough.
  >> 
  >> Regards
  >> Roland Carlsson
  >> 
  >> PS: Please don't send secure messages to a mailinglist. If 
  >you need them to be secure add a hash in the end of the 
  >message so it can be verified to be not alterd. 
  >> 
  >> ----- Original Message ----- 
  >>   From: Edson Carlos Ericksson Richter 
  >>   To: 'OJB Users List' 
  >>   Sent: Monday, September 08, 2003 3:56 PM
  >>   Subject: How to use DUAL
  >> 
  >> 
  >>   Hi!
  >>   I want to execute a query in OJB to obtain database server 
  >DATE. The query is
  >> 
  >>   select TIMESTAMP from DUAL
  >> 
  >>   How can I accomplish this using OJB? Should I use Procedures?
  >> 
  >> 
  >> 
  >>   Thanks,
  >> 
  >>   Edson Richter
  >> 
  >> 
  >> 
  >>   ---
  >>   Outgoing mail is certified Virus Free.
  >>   Checked by AVG anti-virus system (http://www.grisoft.com).
  >>   Version: 6.0.515 / Virus Database: 313 - Release Date: 1/9/2003
  >
  >
  >---------------------------------------------------------------------
  >To unsubscribe, e-mail: [EMAIL PROTECTED]
  >For additional commands, e-mail: [EMAIL PROTECTED]
  >


  This email and any attachments are strictly confidential and are intended
  solely for the addressee. If you are not the intended recipient you must
  not disclose, forward, copy or take any action in reliance on this message
  or its attachments. If you have received this email in error please notify
  the sender as soon as possible and delete it from your computer systems.
  Any views or opinions presented are solely those of the author and do not
  necessarily reflect those of HPD Software Limited or its affiliates.

   At present the integrity of email across the internet cannot be guaranteed
  and messages sent via this medium are potentially at risk.  All liability
  is excluded to the extent permitted by law for any claims arising as a re-
  sult of the use of this medium to transmit information by or to 
  HPD Software Limited or its affiliates.



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



  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.516 / Virus Database: 313 - Release Date: 1/9/2003

Reply via email to