Storing location specific time in Database

I have a requirement to store Location Specific Time in Database.
Our Database Servers and OC4J run with US Central timezone. This causes all the "Date" mappings in my Entity to be stored in US Central timezone.
My Entity
StopId-----------------PickUpDateTime-----------------LocationId
As per above structure "PickUpDateTime" is a DATE type field and i want to store Date and Time value as per Location id. I have a utility to get TimeZone from "LocationId".
So If "LocationId" represents "New York", i want to see Time in Eastern Timezone.
For example, "PickUpDateTime" is 2 PM Central, i want to see 3 PM in the Database.
I was not able to use "Timestamp with Timezone" and in some cases we have to use "DATE" type in our Database Table. How can i achieve this?
Chandresh

Hi Folks, Hopefully this will be a simple one for
you.
I need my store method of my Database
class to take only a Record object as a
parameter. How can I use an if statement to do
the check? Any help would be greatly appreciated.
Cheers, LBCheck what?
How does a Record know how to store itself?
Does a Record map 1:1 to a table, or are there JOINs involved?
public class Database
    void store(Record record)
        record.store();
}Your question is too general and vague.
%

Similar Messages

  • Trigger which fire on a specific time ?

    Hello expert,
    my requirement is to automatically cancel requisition's which are older than 3 day's.
    for this i have to create some trigger. i created a trigger on database startup , but if i do not restart my server than
    it will not work.
    i also have create dml trigger but may be it will fire unnecessarily. so suggest me some process which check on some specific time in database
    and cancel the requisition.
    Thanks
    yash

    >
    i create procedure and create a job by scheduler. and its working.
    but i did not understand the dbms_scheduler.create_schedule .
    i used dbms_scheduler.create_job to create a job with procedure to called.
    but how to attach procedure with dbms_scheduler.create_schedule ???
    >
    You don't need to. You can just specify the repeat_interval like the example in the link shows
    BEGIN
      DBMS_SCHEDULER.create_job (
        job_name        => 'test_full_job_definition',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'BEGIN my_job_procedure; END;',
        start_date      => SYSTIMESTAMP,
        repeat_interval => 'freq=hourly; byminute=0; bysecond=0;',
        end_date        => NULL,
        enabled         => TRUE,
        comments        => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    /That example shows that the job will run every hour on the hour. You need to decide how often your job and procedure should run. The procedure should check for cancellations.
    You also need to start revisiting your previous 155 (81 unresolved) threads and mark them ANSWERED as appropriate.

  • How to set a specific time zone for time channel in DIADEM

    Hi,
    I'd like to know how to autmatically set a specific time zone for time channels in DIADEM.
    For example, I have stored data with corresponding time channel in UTC time on a disk which was collected in another time zone. Now I want to analyze this data and I want the time channel to show the local time in the time zone where the data was collected, and not the time in the local time zone where the computer is located.
    The time channel should also take site local summer/winter time into account. Now I'm running a script that handles it for me which adds or subtract hours according to my input. The problem is that I'm handling data from several different time zones and I'm not located in any of them and when you're running a lot of data over a greater time period, it's easy to make mistakes, especially when it comes to summer/winter time. Is there a any clever solution to this already implemented in Diadem that I have not found? 

    Hi hj77,
    No, I'm sorry, DIAdem has no time zone functionality at all.  I'm afraid you have no choice in DIAdem but to keep running your scripts.  Summer and Winter time are truly tricky, because the rules for when the changes occur are different in different countries and states within countries and also can change from year to year within the SAME country (as they did in the US a few years ago).
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • I have two users on the same MAC and want to have separate ITunes libraries stored on my time capsule.  what's the best way to ensure that is done?

    I have 2 users on a MAC each with separate accounts (email, photo, ITunes) and I want to migrate my ITUnes Library over to a time capsule so that each usewr still has their own library bu don't want to duplicate songs.  What is the best way to have both Itunes pointed to separate libraries both stored on the Time Capsule?

    A bit of basics on iTunes.  iTunes does 99% of what you see through a library.itl file in the iTunes folder.  This file is a database and in it are references to the actual media files.  These files can be anywhere in theory, but if you have iTunes set to default then they are nicely organized in media folders in the iTunes folder.  You have probably moved them to some central shared location in the past, then built up two individual libraries around that central location.
    iTunes is very fussy about a person dragging files to a different location, and that goes double if the other location is on a different drive.  You can move files, but it is best to let iTunes do it so it can keep track.  If this was just for one person I'd say go into preferences, select the other drive for media location, then close preferences. My understanding (never done this before) is iTunes will then ask you if you want to move your media.  Say yes and iTunes will move it and keep track of it -- for your library.  Now when you go to the other person's library, it opens and you see loads of ! because their library is still looking for the media on the same  drive as the library is located on.  I don't think it will work (but you could always try) to re-assign the media location to the external drive because the reference in the database is to look for such-and-such a file on the internal drive.  iTunes did that for the first library as part of the move, but not for the second one.  Note that typically when you want to move a single user's collection from drive to drive we advise moving the whole iTunes folder, library files and all, to another drive, but you don't have that structure.
    So I'm not sure what to advise.  If it were me and I was absolutely gung-ho on doing this I would re-assign the media with one library.  Then edit the .xml version of the library file for the second library so it points to the new file locations and import this into a fresh iTunes library for the second user.  This isn't the perfect solution because nominally the .xml version does not 1005 replicate all the characteristics of the original .itl file (which cannot be edited).
    Or maybe some other user bas a better idea.

  • How do I open a pdf stored in a Microsoft Access database using Visual Basic studios 2012

    Currently I am unable to find a valid method of being able to open a pdf stored in a Microsoft Access database using Visual Basic studios 2012. I've tried displaying the entire database on a form, but when I do this all the other columns show up with
    the correct data besides the one containing the pdf's, it just displays <binary data> in each row down the column. I also tried another method with which you use the database as a dataset and can drag and drop the rows and columns into the form, which
    again works for all the other columns besides the one containing the pdf's but this time I'm unable to interact with the column  at all. 
    Not too sure if this is in the correct place, but any answers or help would be appreciated. Cheers.

    Alex,
    This forum is dedicated to Project and Project Server. You might get better response, if you post to a Visual Basic forum. Here are couple I could find. 
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vbgeneral%2Cvblanguage&filter=alltypes&sort=lastpostdesc
    Cheers,
    Prasanna Adavi, Project MVP
    Blog:
      Podcast:
       Twitter:   
    LinkedIn:
      

  • Render at a Specific Time Every Day

    Is there a way to have a specific Final Cut Pro project to render automatically at a specific time every day?
    I work at a CG house, and shots are updated at random intervals, but are always in a fixed, specific location. So by rendering out the project everyday we would always have an up to date complete edit. And by automating it it could be rendered off hours and be ready first thing in the morning for review.

    Or page 548 of Volume III, if you're on Final Cut Pro 5 (FCStudio 1).
    'Main Menu/Final Cut Pro/User Preferences/General tab'
    FCS2 may allow specific time of day, but FCS1 simply lets you set a period of time (while the program is open, but idle). So set it for 2 hours, leave FCP open when your last editor leaves the office.
    This also offers several choices on which sequences you actually want to 'auto-render'.
    K

  • I have a time capsule with my iTunes library from a previous computer.  I now have a new computer with new songs on my iTunes library.  I'd like to retrieve my songs from my iTunes library which is stored in the time capsule.  How do I do this?

    Hello there.  Wondering if there's any way I can retrieve songs that are stored in my time capsule that was backed up from my old previous computer?

    Actually you always use ethernet..
    MBA does not come with ethernet port.. but apple sells both a cheap usb to ethernet and a much more expensive and much faster thunderbolt to ethernet adapter. With ethernet to eliminite this silly situation of setting up wireless over wireless, so if you make any change you instantly drops you off the network. Like cartoons of people sawing off the branch they are sitting on.
    But you can reset.. no reset will do anything at all to the material on the hard disk. You must deliberately erase it.
    Read the info because you may only need to do a soft reset. That is hold the reset for 1sec (2-3sec is fine)  as long as you don't hold it for a full reset.
    http://support.apple.com/kb/ht3728
    Even a full factory reset will not harm your files in any way, (or any further!!)
    I am "concerned" that you have no backup to vital files on your TC. That is not wise. TC are no more immune to failure than any other hard disk.. (actually latest ones use the cheapest green WD drives money can buy) and keeping files in only one location is a receipe for disaster. An external drive is much more accessible.. cheaper and tend to be more reliable. There are too many things to break in the TC.. it is designed as a backup target for TM. Not a file store.

  • We are getting ¿ stored into our Oracle 10g database  (Microsoft fault)

    We are getting ¿ stored into our Oracle 10g database that is using WE8ISO8859P1 character set.
    Problem is caused by the following:
    Microsoft released software (in particularly MS Word) before considering any ANSI or ISO standard (although they claimed so).
    At that time of pioneering graphical interface - they were the standard. Since then things changed. Microsoft initially targeted US marked, however very soon they wanted to expanded to Europe. For that they needed to get standardized character set instead of one initially being in use. Microsoft re-mapped character set in newer applications using Windows-1252 character set which is compatible with ISO-8851-1 (we are using in our Java Web applications). That cleared obstacles to forward on European market, where extended characters are necessary (like in French, Dutch, German languages...)
    What happened with the initial character codes before Microsoft agreed with ISO to standardize characters? Well - Nothing.
    So what are the consequences of that?
    If we are using Microsoft Word document in conjunction with one of the oldest character set (universe) the ice-age character mapping is still there. So when we "cut and paste" the content to another application, characters sets are not mapped anymore. Especially French language "is sensitive to this" The Microsoft character set in Word decimally coded 146 ( ' ) is very often used in French.
    Therefore if the text is generated in MS Word using old character mapping (universe) which we do, and using method of "cutting and paste" we are mismatching character set interpreted by other, newer applications.
    Initially in the MS words (apostrophe) ' had code 191; then later after implementing Windows 1252 character set being moved to code 146 in accordance to ISO. Well ISO threat character coded 191 as ¿. So if you are using MS Word universe character set, ' looks like ' but in newer applications or ISO compatible applications it looks like ¿.
    Can anyone provide me with periodically cleanup routines that replace garbled characters entered by Microsoft applications into Oracle database ?
    Thanks
    Brendon

    A simply update should work.
    SQL> CREATE TABLE CHARTESTING(COLUMN1 VARCHAR2(30));
    Table created.
    Elapsed: 00:00:00.01
    SQL>
    SQL> INSERT INTO CHARTESTING (COLUMN1) VALUES (CHR(191)||CHR(146)||DBMS_RANDOM.STRING('A',5));
    1 row created.
    Elapsed: 00:00:00.01
    SQL> COMMIT;
    Commit complete.
    Elapsed: 00:00:00.00
    SQL> SELECT * FROM CHARTESTING;
    COLUMN1
    ┐ÆTeoqw
    Elapsed: 00:00:00.06
    SQL> UPDATE CHARTESTING SET COLUMN1=REPLACE(COLUMN1,CHR(191),'*');
    1 row updated.
    Elapsed: 00:00:00.00
    SQL> SELECT * FROM CHARTESTING;
    COLUMN1
    *ÆTeoqw
    Elapsed: 00:00:00.00
    SQL>After numerous attempts you will have to trust me that the characters are correct, my sqlplus isn't working for displaying the characters.

  • Execute Java Program in a specific time everyday

    Hi All,
    I need help for Execute Java Program in a specific time everyday.
    I want to do insert data into database every 3:00 AM everyday.
    I thought there is a one thread program will do. It is correct my understanding? Please let me know and guide me How can I do?
    Thanks
    Amit

    If you are using Window$ then you can create a bat file to execute the program and place the bat file in Scheduled Tasks.

  • Proecure to be executed at specific time

    Hi All,
    I have created a procedure which will create table on top of data from another schema, but i want the procedure to be executed at midnight as there would be some udpates in database during the day until midnight. I want to create my tables on top of the database after updates have been commited. Is there anyway to achieve this task to execute my proecure by assigning a specific time?
    Best Regards,
    Lee

    hi
    We use DBMS_JOB.
    But as I read, DBMS_SCHEDULER is a newer feature of ORacle. Can I do everything with scheduler, which I did with DBMS_JOB?
    And can I reach scheduler logs? Finally are there any performance differences

  • IOS7:  "all-day, repeating" entry from all-day to a specific time.

    Since upgrading to ios7 (iPhone 5, Verizon) when using the calendar I can't switch an "all-day, repeating" entry from all-day to a specific time. There's no "all-day" toggle switch.  Does anyone know how to correct this?  My friend has the 5s &amp; AT&amp;T and she doesn't have this problem.  Hers shows a toggle switch!

    I haven't completely discounted it but it seems like I would need to back up to files, then restore from files. I don't want to do that. I want a full file system level SAN snapshot that I can just drop into place. The does work when the production base is shut down. However, considering that I do have archive logs, shouldn't it be possible to use them to recover to a specific scene without having to do an RMAN backup at all? It seems that doing an RMAN backup/recovery would just make this whole process a lot longer since the DB is 160 gigs in size (not huge, but the dump would take more time than I would like). With a SAN snapshot, if I can get this to work, I'm looking at about a 15-20 minute period of time to move the production DB over to test.
    Since you are suggesting that RMAN may be a better approach I'll provide more details about what I'm trying to do. Essentially this is like trying to recover a DB from a server that had its power plug pulled. I was hoping that Oracle's automatic recovery would do the same thing it would do in that instance. But obviously that doesn't work. What I want to do is bring over all the datafiles, redo logs, and archive logs using the SAN snapshot. Then if possible use some aspect of Oracle (RMAN if it can do it) to mount the database, then recover to a specific time or SCN if using RMAN. However, when I tried using RMAN to do it, I got an error saying that it couldn't restore the data file because it already existed. Since I don't want to start from scratch and have RMAN rebuild files that I've already taken snapshots of (needless copying of data), I gave up on the RMAN approach. But, if you know of a way to use RMAN so that it can recover to a specific incarnation without needing to runm a backup first, I am completely open to trying it.

  • Run a Stored procedure in Orchestrator Query Database

    I dont see an option where a stored procedure can run in Database query.
    Instead of putting a query, I would like to have a stored procedure run at different intervals and then send out the notification.
    If it is not in Database Query, Where do I find an option for Stored proc.?

    HI Sd,
    You need to do following for using Stored procedure as polling statement
    1. Right click the project and  select Add-->Add Generated Items
    2. Then select "Consume Adapter Service"
    3. Now the Consume Adapter Service wizard wants us to provide it the required information, so firstly select "sqlbinding" against the label Select a binding.
    4. Click the Configure button, on security tab select the Client credential type .
    5. On URI Properties tab:
          -->Type the name of the server where your database is located
         --> Provide the name of the database you want to use.
        --> In front of InboundId  , type the name whatever you want so as to  identify the purpose of polling. It acts  as a unique identifier which helps in avoiding conflict when you poll same tables for some other purpose.
    6. Binding Properties tab:
         Select Polling  from the dropdown list in front of InboundOperationType
        Give a valid PolledDataAvailableStatement such as (Select count (*) from table1)
     "exec MyStoreProcedureName" from receive location polling statment
    Thanks
    Abhishek

  • Can you schedule pages to load at a specific time?

    Is it possible to schedule a page to load at a specific time/date? For example, I need my home page to update at 9am on Friday, but I will be out of the office at that time, can Dreamweaver do it for me automatically?
    I am using Dreamweaver CS3 on a Mac running OSX 10.4.11.
    Thanks,
    Elliott

    Here's a very simple sample using php. As its Thursday you will get the message 'This is Thursday and our prices are reduced by 25%' any other day and you will get the message '10% discount today'
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <?php
    $day = date('l');
    ?>
    <style type="text/css">
    #thursdayOffer {
    width: 400px;
    margin: 0 auto;
    border: 2px solid #900;
    text-align: center;
    #normalOffer {
    width: 400px;
    margin: 0 auto;
    border: 2px solid #900;
    text-align: center;
    </style>
    </head>
    <body>
    <?php
    if ($day == "Thursday") {
    echo "<div id='thursdayOffer'><p>This is Thursday and our prices are reduced by 25%</p></div>";
    else {
    echo "<div id='normalOffer'><p>10% discount today</p></div>";
    ?>
    </body>
    </html>
    Depending on how complex you want to get.....you may need to get the information from a database.

  • Storing an array into the database using jdbc

    Hi,
    i�ve got a problem storing an array into a database. I want to store objects consisting of several attributes. One of these attributes is an array containing several int values. I don�t know exactly what is the best way to store these objects into a database. I have created two tables connected by a one to many relationship of which one stores the array values and the other table stores the object containing the array. Is that ok or should I use another way. It�s the first time I�m trying to store objects containing arrays into a database so I�m very uncertain in which way this should be done.
    Thanks in advance for any tips

    1. You should use blob or longvarbianry type colum to stor that array.
    2. All object in that array should be Serializable.
    3. Constuct a PreparedStatement object
    4. Convert array to byte[] object
    ByteArrayOutputStream baos=null;
    ObjectOutputStream objectOutputStream=null;
    baos = new ByteArrayOutputStream(bufferSize);
    objectOutputStream = new ObjectOutputStream(baos);
    objectOutputStream.writeObject(array);
    objectOutputStream.flush();
    baos.flush();
    byte[] value=baos.toByteArray();
    5. Now you can use PreparedStatement.setBytes function to insert byte[] value.

  • DB Back to a Specific Time with Archive Logs (Until cancel or time?)

    I'll try to be as clear as possible with my intended goals and the limitations of the system I'm working with:
    1. We have a test instance of our Oracle DB that I would like to be able to refresh with data from the production instance at any time, without having to shut down the production database or put tablespaces into hot backup mode.
    2. Both systems are HP Itanium boxes with differing numbers of CPUs and RAM. Those differences have been taken into account in the init.ora file for the DB instances.
    3. The test and production instances are using a SAN to hold the following file systems: ora_redo1, ora_redo2, ora_archlog, oradata10g. The test instance is using SAN snapshots (HP EVA series SAN) of the production file systems to pull the data over when needed. The problem is that the only window to do this is when the production system is down for nightly maintenance which is about a 20 minute period. I want to escape this limitation.
    What I've been doing is using the HP SAN to take snapshots of the file systems on the production system mentioned above. I do this while the production DB is up and running. I then import those snapshots into the test system, run an fsck to ensure file system integrity, then start up the Oracle instance as follows:
    startup mount
    Then I run the following query I found on line to determine the current redo log:
    select member from v$logfile lf , v$log l where l.status='CURRENT' and lf.group#=l.group#;
    Then I attempt to run a recovery as follows:
    recover database using backup controlfile until cancel;
    When prompted, I enter the path to the first of the current redo logs and hit enter. After waiting, sometimes it says that the recovery completed, other times it stops saying there was an error and that more files are needed to make the DB consistent.
    I took the above route because doing a recover until time (which is what I really want to do) kept prompting me for the next archive log in sequence that didn't yet exist when I took the SAN snapshot. Here was my recover until time command:
    recover database until time 'yyyy-mm-dd:hh:mm:ss' using backup controlfile;
    What I would like to do is take the SAN snapshot and then recover the database to about a minute before the snapshot using the archive logs. I don't want to use RMAN since that seems to be overkill for this purpose. A simple recovery to a specific point in time seems to be all that is needed and I have archive logs which, I assume, SHOULD help me get there. Even if I have to lose the last hour's worth of transactions I could live with that. But my tests setting the specific time of recovery to even 12 hours earlier still resulted in a prompt for the next, non-existent archivelog.
    I will also note that I even tried copying the next archive log over once it did exist and the recovery would then prompt me for the next archive log! I will admit right now that I really don't know a whole lot about Oracle or DBs, but it's my task to try and make it possible to "refresh" the test DB with the most recent data with no impact on the production DB.
    The reason I don't want to use hot backup mode is that I don't know the DB schema other than there are probably 58 or more tablespaces. The goal is to use SAN snapshots for their speed instead of having to take RMAN files and copy them to the test instance. I'm sure I'm not the only person who has ever tried this. But most of what I've found on line refers to RMAN, hot backup mode, or down time. The first two don't take advantage of SAN snapshots for a quick swap of all the Oracle file systems and I can't afford downtime other than that window at night. Is there some reason that the recover to time didn't work even though I have archive logs?
    One final point. The recover until cancel actually worked a couple of times, but it seems to be sporadic. It likely has something to do with what was happening on the production DB when I created the SAN snapshots. I actually thought I had a solution with recover until cancel last week until it didn't work three times in a row.

    I haven't completely discounted it but it seems like I would need to back up to files, then restore from files. I don't want to do that. I want a full file system level SAN snapshot that I can just drop into place. The does work when the production base is shut down. However, considering that I do have archive logs, shouldn't it be possible to use them to recover to a specific scene without having to do an RMAN backup at all? It seems that doing an RMAN backup/recovery would just make this whole process a lot longer since the DB is 160 gigs in size (not huge, but the dump would take more time than I would like). With a SAN snapshot, if I can get this to work, I'm looking at about a 15-20 minute period of time to move the production DB over to test.
    Since you are suggesting that RMAN may be a better approach I'll provide more details about what I'm trying to do. Essentially this is like trying to recover a DB from a server that had its power plug pulled. I was hoping that Oracle's automatic recovery would do the same thing it would do in that instance. But obviously that doesn't work. What I want to do is bring over all the datafiles, redo logs, and archive logs using the SAN snapshot. Then if possible use some aspect of Oracle (RMAN if it can do it) to mount the database, then recover to a specific time or SCN if using RMAN. However, when I tried using RMAN to do it, I got an error saying that it couldn't restore the data file because it already existed. Since I don't want to start from scratch and have RMAN rebuild files that I've already taken snapshots of (needless copying of data), I gave up on the RMAN approach. But, if you know of a way to use RMAN so that it can recover to a specific incarnation without needing to runm a backup first, I am completely open to trying it.

Maybe you are looking for