UPdate by an hour

Hi Der,
I am stuck in here to update to scedule the report by an hour later if failed
Here is the piece of code, and my objective is to update the Schedule date by an lhour later of pickup date
Please advise
Timestamp U_Pdate = rs.getTimestamp("sr_pickup_date");
        String Udef = rs.getString("REP_DEFN_NAME");
        String UEmail = rs.getString("REP_EMAIL_ADDRESS");
        int UID = rs.getInt("REP_CUS_ID");
        int UCid = rs.getInt("REP_CREATED_BY_ID");
        //Ends here
      String emailTo = props.getProperty(PFEConfigItems.EMAIL_ERROR_ADDRESS);
      String subject = "Report Generation Failed (" + scheduleId + ")";
      String message = subject + "\n\nMessage: " + error + "\n\nDetail:\nID: "+ Udata+ "\n\nDescription: "
      + Udesc+ "\n\nCreated Date: "+ U_Cdate+ "\n\nSchedule Date: "+ U_Sdate+ "\n\nPickup Date: "+ U_Pdate
      + "\n\nReport Generated: "+ Udef+ "\n\nEMAIL ADDRESS: "+ UEmail+ "\n\nCustomer ID: "+ UID
      + "\n\nCompany ID: "+ UCid;
      String from = props.getProperty(PFEConfigItems.EMAIL_FROM_NAME);
      String emailFrom = props.getProperty(PFEConfigItems.EMAIL_FROM_ADDRESS);
      MailDispatcher dispatcher = new MailDispatcher(new Properties(),props);
      dispatcher.sendMessage(emailTo, subject, message, from, emailFrom, null);
      //these are update changes
      StringBuffer sql1 = new StringBuffer();
      sql1.append("Update scheduled_report ");
//Here is my problem when I am trying to set the schedule date to pickupdate
      sql1.append("set sr_scheduled_date = to_date('"+U_Pdate+"','dd/mm/yyyy hh24:mi:ss') ");
      sql1.append(",sr_pickup_date = null, sr_processor_id = null ");
      sql1.append("where  sr_id = ");
      sql1.append(scheduleId);
      PooledConn pc2 = null;
      Statement stmt2 = null;
      pc2 = getConnection();
      stmt2 = pc2.get().createStatement();
      stmt2.execute(sql1.toString());
      pc2.commit();

First you start by using a PreparedStatement rather than creating the SQL yourself.
Second you use a Calendar to add an hour before.

Similar Messages

  • My Firefox updated about 2 hours ago. Now it crashes everytime I try to open it. Could someone please help me? I am now stuck on IE :(

    My Firefox updated about two hours ago. When I tried to open it after the update, it crashed and so I chose to start a new session. Now it won't open and I get a message saying "Firefox has stopped working. Windows is checking for a solution to this problem... Windows will close the program and notify you if a solution is available." Please help.

    Have you tried closing the iTunes store app via the multitasking bar and seeing if it works when you re-open it
    Have you tried closing the app via the taskbar ? (I assume that your iPad is on iOS 6, though the version that your tagline shows, 6.1.6, is not a version for iPads) From the home screen (i.e. not with iTunes store app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the iTunes app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't fix it then you could try a soft-reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • Will they ever give me an update after 24 hours

    I put my order 24th July, they gave me an estimate date on 12th, Aug for activation. but nothing happened on 12th, Aug. So I phoned BT customer service, they helped to have a check and said there was some issue with Exchange and they would work on it, then they asked me to call back after 24hours.
    I called them today, a not very friendly customer service staff asked me to explain all the story, and she said, I will have a check, just after one minute, she told me, sorry, we have some problem with the system and we couldn't give you any update unitl Monday, it's just the date they will give me an update.
    My doubt is whether they can give me an update then, they don't even send out an email to tell you what happend, everything you need to find out yourself and wait for 10 to 20 mins to get the perfect anwser. "we will give you an update after 24 hours"
    Solved!
    Go to Solution.

    Hi Piaf,
    Thanks for the posts and welcome to the forum.
    I can help you with this.  Please drop me an email to [email protected], include any order numbers that BT have supplied plus your full address.  I will be able to locate your order from this info and let you know what is going on.
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • HT1338 error in download, OS X 10.8.3 now checking for updates for 14 hours cannot get out of it!!!

    Error with downloading upgrade OS X 10.8.3 now checking for updates for 14 hours cannot get out to start again!!!

    Quit the App Store application, or force-quit if necessary.

  • How to update multiple calling hours based on business partner

    Hi All,
    please help me in this issue : how to update multiple calling hours based on business partner in SAP CRM.
    Regards,
    Siva kumar.

    Check maintainance view V_TB49, add new scheduling type.

  • Restrict Employee From Updating a Particular Hours Type

    Hi..
    We have the following scenario.
    1. We have 3 types of Elements defined for OTL i.e. Regular Hours , Overtime Weekend and Overtime Weekday.
    2. The Regular hours are integrated with the client's time Machine.
    3. Each night the regular hours are updated for each employee.
    4. Now as per the client, the employee can update/add Overtime Weekend and Overtime Weekday but should not be able to update the regulars hours (created through Interface).
    can anyone kindly update us, how can we achieve this requirements (it may be a setup or fast formula).
    Thanks
    Regards

    Dear User,
    We don't have any preferences to update/Modify for any element.
    If there is anything available can you please clarify. We are on version 12.06.
    Regards

  • Just got iPad.  When I sync to computer/iTunes to start, it says that software update willtake 11 hours?

    just got iPad, why does it say software update takes 11 hours when I try to update on my iTunes?

    I just did mine last night and it took about 20 minutes. Either you have a very slow connection or something is interfering, like virus software or a firewall.

  • ICloud Mail file is not updating after many hours, many new attempts

    I installed Lion OS on my MacBook Pro (2010) and moved from mobileme to iCloud.  When I open my Mail program, it has said it needs to update my Mail files (of course), and I told it to do so.  After letting it sit there literally for 8 hours, power supply plugged in, the bar showing progress of the file update goes only to the 25% finished mark and then just sits there!  I have cancelled that and started over several times and left it updating for 3 hours or more, several more times.
    I realize that my file is big, but if it were too big or choking and freezing, it would show "Not Responding" if I tell it to Force Quit.  So far this mail file update process has NOT made Mail show as "not responding" upon Force Quit.
    I have set my power supply Energy Saver settings in System Preferences to "never" shut down (only for this time period as I migrate to iHell) and I've told it not to shut down the hard disk nor to sleep. 
    The Progress/Status bar just keeps humming along as if it is working on the mail file update....but never moves past about 25% complete.
    Help!!!

    Here is what I've been seeing for HOURS at a time...never going past this 25% completed mark:

  • ITunes updates podcasts each hour but won't refresh. When I sync my iPhone, it gets yesterdays podcasts and I have to manually hit refresh to make it update. How can I make it automatically refresh?

    iTunes updates podcasts each hour but won't refresh. When I sync my iPhone, it gets yesterdays podcasts and I have to manually hit refresh to make it update. How can I make it automatically refresh?

    I think figured out what is going on here... If you have set your Windows OS time manually, Apple iTunes will not honor the time you set in Windows XP...
    In my case, I had not applied the Windows update that changes the Daylight savings rules. No big deal I thought... I can easily correct the time manually. Well... iTunes will not like it if you do that. You have to have your daylight savings rules set correctly on the PC. Microsoft has a free program called TZEdit that will let you adjust the DST boundaries.
    Once I set the rules correctly and then set my time keeping back to "Automatic" it fixed it. Hope this helps...

  • Iphone 5c saying verifying update for 3 hours and wont go away any help?

    Iphone 5c is saying verifying update for 3 hours but wont go away any help?

    That error is usually a hardware error. Make a Genius Bar appointment at your nearest Apple Store and have it checked.

  • Updating N96 14 hours!!

    Hi, the new software for my N96 is updating for 14 hours now.I can't disconnect my phone from my computer.Is it normal that it takes this long?
    Message Edited by jaeela on 13-May-2009 09:21 AM

    It is not normal and something has most likely gone very wrong.
    On a fast internet connection it should only take between 2 to 15 minutes to download the firmware then around 5 minutes to update the phone.
    You should never attempt to update on a slow or unstable internet connection.
    If the phone is still on and working it is safe to disconnect the cable.  If the phone is off all you can do is remove the cable, then try it to see if it's working.
    If it isn't working see here:
    /discussions/board/message?board.id=topfaq&thread.id=112

  • HT4623 My computer says that my update has 20 hours till its updated

    My computer says that my update has 20 hours till its updated but it isnt working, when i go on to my phone it says that i cant update it on my phone as my icloud has to finish restoring? can someone help me

    Thanks ckuan, that has at least got it opening and "looking likely".  I had tried that, but perhaps not holding those two buttons for long enough...
    It says no SIM card and is very slow.  Have reinserted sim a few times and now registering sim.  The screen where you have to enter your password to unlock the sim was 'patchy', not clearly showing.  (e.g. the circles around the numbers seem to be coloured, not the usual plain white circles around the numbers/letters).  Never seen that before.
    Battery showing as full.  I'll now and upgrade my software
    Thanks very much for your help

  • Calendar keeps updating/syncing for hours

    Sometimes when I wake up my Mac in the morning, my Calendar App starts to update/sync with iCloud (looking for changes myde on my other devices or new invitations) – and then remains in that mode for hours. I can´t get it to really sync and show new events by re-opening the app or pressing comand-R. Often a restart of the Mac does´nt solve that. I thought it might be a problem with iCloud service not being available but if I browse to iCloud.com I can reach the service and see the new entries in the calendar. Any suggestion?
    Till

    I've heard of some people having this issue, and when I told My friends to not let the computer sleep, and they only took an hour to update it.  including myself... Hopefully you can try to restart it and try from there not letting it sleep.

  • I have a disabled iphone 4 and when i try restoring it, it says i need a update and restore it and its been downloading the update for 6 hours

    i bought a iphone from my freind and its disabled and i have tried to restore it but when i do i tells me i need a update, and when i do this it tells me i need to wait 6 hours for the update and i just need to restore the iphone. i need help

    Hey rox,
    I'd say it's possible that you internet connection is slow. I would try to cancel the download and possibly restart the router, then try the update again.
    Check you internet speed here.
    http://www.speedtest.net
    Hope this helps

  • I tried to restore my iPod Touch after too many incorrect passcodes were tried.  iTunes downloaded an update for 4 hours, but nothing changed with the iPod.

    My daughter's friends tried to guess her password on her iPod Touch 4th generation too many times, and now she is locked out, and the iPod displays the message, "iPod is disabled.  connect to iTunes."  I connected it and tried to restore it.  iTunes recognizes the iPod.  iTunes said it needed to download an update, although everything on both the iPod and iTunes should be current.  The update ran for over 4  hours, but when it ended, nothing else happened.  The iPod is still disabled.  How can I fix this?  Thanks.

    - Try a reset. Nothing will be lost.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Next try a manual install. See:
    iDevice Troubleshooting 101 :: iPhone, iPad, iPod touch
    - Place in recovery mode and the retore. For recovery mode:
    iPhone and iPod touch: Unable to update or restore

  • Why 2GB Lion Combo Update takes 4 hours to download?

    Why 2GB Lion Combo Update 10.7.5 takes 4 hours to download from Apple Servers? I cannot update from Software Update app. In two tries, 8 hours waiting, two times after download finish, get download error. Software Update could not save the file. Any suggestion? Thanks!

    depends on Broadband download speed or cellular speed from your carrier

Maybe you are looking for