Storing date and hour in JDBC app

I know that this is not exactly a JDBC problem, but some one could have
some experience on it.
I am storing the date and the time when a product change, I have 2 questions,
How i can get the exact hour that the system is indicating in windows, no matter the time zone?
And how i can do a validation to not let someone change the hour; or the date, if the application can not connect to Internet.

Hi Battosai,
Not sure about your second question, but as for your first question...
"How i can get the exact hour that the system is indicating in windows, no matter the time zone?"
Use the getTime() function in java.util.Date
Hasman.

Similar Messages

  • When I send messages off-line, they enter in the addressed mailbox with the date and hour which I've clicked "Send later". How could I set up to the real time?

    When I send messages off-line, they enter in the addressed mailbox with the date and hour which I've clicked “Send later”. How could I set up to the real time?

    What you say about Send Later timestamp is correct.
    When you click Send or Send Later a time is set regardless of when you actually sent the Send Later email.
    Please voice your vote at this link:
    https://bugzilla.mozilla.org/show_bug.cgi?id=560901
    You will need to logon/register.

  • Extracting date and hour component from time stamp in diadem ?

    Hi all, 
    I am just getting started with DIADEM.
    I have a column with time stamp format as 4/12/2014  12:03:00 AM, i need to extract date and hour compenents only and store in another column.
    Can anyone please give me some lead on this?
    Please ask for extra infor if required

    Hi figured it out.
    I used this.
    str(chd(i,"P1_ACCH_1/Time_Stamp"),"#MM/DD/YYYY hh"))

  • Sudden change date and hour

    Hi,
    yesterday I turned on my Mac and, after typed my password to login in, I found a warning icon telling that the date and the hour is changed to 01 January 2001, 03.05.00 (I don't remember very well the hour).
    So I adjust the date and the hour in the Date and Hour Setting, then I found that the computer asked to select the home wireless network as if it is the first time I used the Pc. Obviously I selected my wireless network with his password, and everything was fine.
    And today is fine.
    But my question is : this sudden change of date and network is work of a malicious cookie, or malware? Or a problem of the OS X?
    I am very careful with downloads from internet: I download only from well-known sites (as university, documents from my friends..), but should I delete the cookies from Safari and Firefox?
    Marta
    PS= before I write this post, I looked for information on my computer, but I don't understand much...

    First, it would be helpful to know what model of computer you have.
    Any time the date and time reset, it is likely because of an SMC reset. This can happen under several scenarios, the most common being that your computer lost power entirely. Current laptops have a coin battery in addition to the main battery that actually powers your computer. That way if the main battery dies, the coin battery still keeps the date and time settings. If the coin battery is bad (or if you have an older computer like an iBook or 12" PowerBook that doesn't have one) and your main battery dies, the date and time will reset.
    If you have an iMac, and your computer was unplugged or if your home was without power for a length of time, it's also possible for this to happen, but it depends on the model as to the specifics.
    It is not likely the cause of a 'malicious cookie or malware', Macs very rarely get viruses.

  • Exif Date and hour data

    How to change Date and Hour (Exif or IPTC IIM)with Adobe Bridge CS3?

    Hi,
    I have the exact same problem - corrected the EXIF date and time and still wrong sorting. The thing is that Bridge sorts the files by "Creation Date", the date and time you also see in the Finder. So I found an application that can change that, too. But still Bridge sorts the files in the wrong order! Displays the old time, too.
    After several times of emptying the cache, sorting is now ALL messed up (without any kind of logic), I don't know how to fix it.
    Regards,
    Charles

  • Hi,I want  ABAP program to create an file of this data and to upload in app

    Hi Sir/Madam,
               I want  ABAP program to create an file of this data and to upload in application server.this is urgent requirement.plz reply soon. i'll b thankful to u.
    Regards,
    Vishali

    Hi ,
    Use this abap code .this will create a file in AL11 that you can use .
    data: d_msg_text(50),
          v_string(20000) type c,
          v_filename type rlgrap-filename,
    ******Create a file on app server
    concatenate '<directory name present in AL11 case sensitive>' ' filename.CSV' into v_filename .
    condense v_filename no-gaps .
    open dataset v_filename for output in text mode
    encoding default message d_msg_text.
    if sy-subrc ne 0.
      write: 'File cannot be opened. Reason:', d_msg_text.
      exit.
    endif.
    ****Header for file
    concatenate 'information you want to write in file like header etc ' into v_string separated by '|'.
    transfer v_string to v_filename.
    *****Write data into file by looping an internal table
    loop at  <internal table > assigning <work area>.
      concatenate      <work area>-field name1   <work area>-field name2    into v_string separated by '|' .
      transfer v_string to v_filename.
    endloop.
    close dataset v_filename.
    Hope this will solve your purpose.
    Regards,
    Jaya Tiwari

  • N95 and set date and hours

    Hello,
    My N95 for a few days has required of me with each time I start
    it the date and the hour. If not, all functions well.
    According to you, is this a breakdown (panne) ?
    (sorry for my english)
    Thank you

    hi try this:
    turn off your phone and remove battery and sim card
    then install them and turn your phone on.
    in setting menu,date and time change your time zone if its incorrect and chang off network operator time.
    i hope your broblem be solved.
    NOKIA means:Night Of King In Alone

  • Date and Hour Prompt

    I have an hourly report and the client wants to have a dashboard that would filter the report to the user's desired start datetime to end datetime.
    Sample:
    Dashboard Prompt:
    Start Date: 9/1/2013 Start Hour: 0500
    End Date: 9/3/2013 End Hour: 1700
    Report should display:
    DATE      |  HOUR
    9/1/2013  |   0500
    9/1/2013  |   0600
    ...           |
    9/3/2013  |   1600
    9/3/2013  |   1700
    I tried this report using timestamp as the prompt. However, in this case, the user would have to input the date and time into the edit box provided. What the client wants is to input the Date (calendar edit box) AND select the Hour via a dropdown menu.
    How do I structure the report as well as the prompt in this scenario?
    Thanks for any help.
    Btw, currently using OBIEE 10g.

    Sorry for that.
    What I mean was this:
    DATE      |  HOUR
    9/1/2013  |   0500
    9/1/2013  |   1700
    ...           |
    9/2/2013  | 0500
    ...           |
    9/2/2013 | 1700
    ...           |
    9/3/2013  |   0500
    ...           |
    9/3/2013  |   1700
    I want to have the result wherein the start datetime of the data is on 9/1/2013 0500 up to 9/3/2013 1700. In the scenario above, the result I'm given is only for the hour 0500 to 17:00 for the 3 dates.
    I hope that clarifies some things.
    Thank you.

  • Date and currency in business apps

    Last year, I was concerned about the difficulty to use java.util.Date class in business applications.
    See thread "Date is a mess for business use" at http://forum.java.sun.com/thread.jsp?forum=4&thread=464726
    And yes, I continue to think that a Date with 61 seconds in a minute is unusable in a business environment !
    We need to store business dates, not timestamps.
    Working for an insurance company, suitable date and currency classes are of paramount importance, but Java doesn't include such classes, rendering its use very difficult, not to say almost impossible.
    I just give here a pointer to some very interesting articles I just came across lately.
    I think it can be of some help to people facing the same problems as me about Date and currency storage.
    http://www.idinews.com/darkside.pdf
    http://www.idinews.com/freeware.html
    http://www.idinews.com/sourcecode/DateJava.html
    http://www.idinews.com/sourcecode/MoneyJava.html
    At last, with these two classes, we can do the same data processing as we did with all our cobol programs.
    Happy reading !

    I tried using the Money class on the compound interest example from http://www.cs.princeton.edu/introcs/91float/. Here's my code:
    Money deposit = new Money(1000d);
    System.out.println("Deposit = "+deposit);
    System.out.println("Double precision interest = "+
         deposit.mpy(Math.pow(1 + .05 / 365, 365)));
    Money dailyAmount = new Money(deposit);
    for (int i = 0; i < 365; i++)
              dailyAmount = dailyAmount.mpy (1 + .05 / 365);
    System.out.println("Daily calculated interest = "+dailyAmount);The output looks like:
    Deposit = $1,000.00
    Double precision interest = $1,051.26
    Daily calculated interest = $1,049.40But the second value should be $1,051.27. Because Money uses a long to represent the amount I end up missing a penny when double precision rounding is applied, and because it rounds down I end up missing almost $2 when the amount is calculated daily.

  • Transaction count for a Date and Hour

    Hi,
    We have a audit table called ALL_RT_AUDIT_MAP_RUNS which keeps number of transactions by jobs. We would like to find out, for a date, which Hour is having the maximum number of transactions.
    We have written the following query but it does not give 'which hour'? please help
    select Date_d,MAX(Tx_Cnt)
    from
    select trunc(end_time) Date_d,SUBSTR(TO_CHAR(end_time,'YYYY MM HH24 MI SS'),9,2)hr, sum(NUMBER_RECORDS_INSERTED) + sum(NUMBER_RECORDS_UPDATED) + sum(NUMBER_RECORDS_DELETED)+sum(NUMBER_RECORDS_MERGED) Tx_Cnt
    from ALL_RT_AUDIT_MAP_RUNS
    group by SUBSTR(TO_CHAR(end_time,'YYYY MM HH24 MI SS'),9,2),trunc(end_time)
    order by 1 desc
    group by Date_d
    Regards, Anirban

    What about something like this:
    select Date_d,MAX(Tx_Cnt)
    from
    select to_char(end_time,'YYYY MM DD HH24:MI') Date_d, sum(NUMBER_RECORDS_INSERTED) + sum(NUMBER_RECORDS_UPDATED) + sum(NUMBER_RECORDS_DELETED)+sum(NUMBER_RECORDS_MERGED) Tx_Cnt
    from ALL_RT_AUDIT_MAP_RUNS
    group by to_char(end_time,'YYYY MM DD HH24:MI')
    order by 1 desc
    group by Date_dBye,
    Antonio

  • I can't activate my apple Tv and set date and hour. Why?

    I bought my apple Tv and when i's trying getting started It, the message "Ativation" and "seting date and time" never desapear.
    If I try to force to go to menu, I can't activate my itunes account...
    Anybody could help me?

    Welcome to the Apple Community.
    Assuming this is not the first time you have used your Apple TV
    You might try restarting the Apple TV by removing ALL the cables for 30 seconds.
    Also try restarting the router.
    If the problem persists, try a restore, you may want to try the previous procedures several times before doing this.
    If restoring from the Apple TV doesn't help, try restoring from iTunes using a USB cable.
    If this is a new Apple TV, it may also be that your network router is not allowing access to the timeserver, check that your router allows access over port 123.

  • How to view Date and Time in messages app?

    How do I display the date & time of every individual message, in "Messages" app [Version 8.0 (4226)] for OS X (10.9.4)
    It seems to sort messages sent within a few minutes of each other as conversations, and only inserts a timestamp every 5 or 6 messages....I need to see the date & time of each one.
    I know you can do this on the iPhone by pulling the screen to the left, so the data is there..., but I cannot figure out how to view it on my iMac.
    Thanks!

    Hi,
    Mouse over the text or Pic that was sent.
    That little boxed time stamp will appear  (It may be a yellow box in a Mavericks boot)
    9:13 pm      Saturday; August 9, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • How to edit XML parsed data and save on iPhone app

    Hi,
    How to edit and XML retrieved data that is displayed on an iPhone app and save again in the same XML file using iPhone SDK.
    In other words I want to change the XML file data or edit and save.
    Thnx in advance.
    Regards
    Amit

    Hello amit,
    No, not at all. Surely you will parse your XML file using the NSXMLParser class. OK! i think i get it now, do you wants to change/modify the value of any tag in the XML file? For that you will be required to parse your XML file using NSXMLParser class, and fill out some data structure (according to the the XML format) do some changes into your data structure, and then write your XML to the file (according to the edited data structure) using the method i told u earlier. This is what my preferred method is, and i am pretty much sure that it is not a bad way to do this at all.
    Hope this clarifies some of your queries.
    Best regards,
    Obaid

  • Dates and forms with JDBC - there must be a better way...

    Hi,
    I have a backing bean (CustomerBean) extended from class Customer that talks to a DOA for access to a JDBC pooled resource.
    I am having trouble getting an elegant solution for getting dates in and out of the DB using JSF forms.
    My Customer class defines the date as java.sql.Date - passing that through to the form gives errors during validation. The work around I managed to get working is for the CustomerBean to have a method that converts a java.util.Date to a java.sql.Date.
    public void setStartDate(java.util.Date startDate) {
    if (startDate == null)
    super.setStart(null);
    else
    super.setStart(new java.sql.Date(startDate.getYear(),startDate.getMonth(),startDate.getDate()));
    and
    public java.util.Date getStartDate() {
    return super.getStart();
    using:
    <h:outputLabel value="Start"/>
    <h:inputText id="startDate" value="#{customerBean.startDate}" required="false">
    <f:convertDateTime pattern="dd/MM/yyyy"/>
    </h:inputText>
    <h:message for="startDate" styleClass="message"/>
    the super property 'start' is a java.sql.Date. The line that bothers me is:
    super.setStart(new java.sql.Date(startDate.getYear(),startDate.getMonth(),startDate.getDate()));
    it uses deprecated constructor. (java.sql.Date(int year, int month, int day);
    Where should I be looking for a more elegant solution? (GregorianCalendar? Anything else?)
    Thanks in advance,
    - David

    Thanks...
    I did it this way:
    Customer.java has...
    private java.sql.Date start;
    and getters and setters...
    CustomerBean.java extends Customer, has no field but the getters and setters...
    public java.util.Date getStartDate() {
    return super.getStart();
    public void setStartDate(java.util.Date startDate) {
    if (startDate == null)
    super.setStart(null);
    else
    super.setStart(new java.sql.Date(startDate.getTime()));
    seems to work and my customer has it's dates as sql dates (that way I only convert dates when I actually need them updateable on screen rather than each read of a customer record from the DB.)
    To display the date I use
    <h:outputText value="#{customerBean.startDate}">
    <f:convertDateTime dateStyle="full"/>
    </h:outputText>
    To edit it, I use
    <h:inputText id="startDate" value="#{customerBean.startDate}" required="false">
    <f:convertDateTime dateStyle="short"/>
    </h:inputText>
    Is this a valid or recommended way?
    - David

  • Zip the data and send through JDBC adapter.

    hi,
       I need to retrive the data from database, zip it and send to xi. At the receiver and i need to unzip it.
    I know that it can be achieved using java mapping. Is there any other solution?

    Hi,
    This will help you
    Zip-Transfer-Unzip: Increase the performance of your Java-ABAP applications
    Working with the PayloadZipBean module of the XI Adapter Framework
    REgards
    Seshagiri

Maybe you are looking for