Re: accurate time of Date in SQLTemplate

From: Alan Guo (AGU..ndependenthealth.com)
Date: Mon May 23 2005 - 13:22:44 EDT

  • Next message: Joshua Pyle: "Re: accurate time of Date in SQLTemplate"

    I just use the function in Oracle as following:

    TO_CHAR(lastchangedate , 'MM/DD/YYYY HH24:MI:SS') LAST_CHANGE

    in the SQLTemplate string instead of getting "Date" value directly from Oracle db.

    But I do feel this is a bug in SQLTemplate in cayenne implementation.

    Alan

    CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State confidentiality laws, rules or regulations. This e-mail and attachments, if any, are intended for the designated addressee only . If you are not the designated addressee, you are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your computer. Thank you for your attention.

    >>> joshua.t.pyl..mail.com 05/23/05 01:07PM >>>
    Share please, in case others do the same thing :-)

    -- 
    Joshua T. Pyle
    Go has always existed.
    

    On 5/23/05, Alan Guo <AGU..ndependenthealth.com> wrote: > Hi, All. Never mind. I figured out how to solve it. > > Alan > > CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State confidentiality laws, rules or regulations. This e-mail and attachments, if any, are intended for the designated addressee only . If you are not the designated addressee, you are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your computer. Thank you for your attention. > > > >>> AGU..ndependenthealth.com 05/23/05 09:37AM >>> > Hi, All, > > I used SQLTemplate to get a date from Oracle db using cayenne SQLTemplate as following: > > String ssql = "select lastchangedate from logindata"; > SQLTemplate query = new SQLTemplate(LoginData.class,s sql, true); > List resultList = context.performQuery(query); > > DataRow dw = (DataRow) resultList.get(0); > String idkey = new String("LASTCHANGEDATE"); > Date ddd1 = (Date)dw.get(idkey); > > Then I format the ddd1 into a string using "MM/dd/yyyy HH:MM a" format. > > What I found out is that hour and minute are not right from the accural time in DB. > > Could anyone let me know what the problem is using SQLTemplate to get the Date this way? > > Thanks, > > > Alan > > > > CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State confidentiality laws, rules or regulations. This e-mail and attachments, if any, are intended for the designated addressee only . If you are not the designated addressee, you are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your computer. Thank you for your attention. > > > >



    This archive was generated by hypermail 2.0.0 : Mon May 23 2005 - 13:23:16 EDT