An incorrect Date is insert in the database...

Hi to you all,.

After a very long time, I came back with a small problem, I need your help to solve this problem.

The problem is when I update date of database using the viewobject setter method
row.setAttribute("UpdatedDate",getCurrentDateString());
where
    public String currentDateString = "";
    private Timestamp time = new Timestamp(System.currentTimeMillis());
    public String getCurrentDateString() {
        System.out.println("********************In Get Current Date ************************");
        SimpleDateFormat  sdf2=  new SimpleDateFormat("MM-dd-yyyy"); 
        currentDateString = sdf2.format(time);
        System.out.println("Time : " + currentDateString);
        
        return currentDateString;
    }
I'm wrong in the database value as if I update date 05/01/2009 I get date in the database as of October 30, 2006...

in my viewobject I use the date format is YYYY-MM-DD.

but still I don't know how to track the problem.

I need your help

Thank you very much
FIZZZ...

Fizz,

Why you set an attribute called "UpdatedDate" (guess it must be a date) to a string value? If UpdatedDate is a date, assign a date.

([url http://forums.oracle.com/forums/thread.jspa?messageID=1639196] this is the answer to the question will probably then ask ;)))

John

Tags: Java

Similar Questions

  • At what stage of the treatment we use a rule to update to apply logic to the way the data are updated in the database?

    Hello

    At what stage of treatment do you use a rule to update to apply logic to the way the data are updated in the database?

    Rahul

    Hello Rahul,

    Update the existing record or a data object

    Thank you

    edynamic expert Eloqua

  • How to filter the form entries before inserting into the database?

    Hello Adobe Forums,

    This is my first post and im a beginner with dreamweaver. I have created two forms on my site, one for messages (contact form) and the other for the testimony. I used the server behavior record insert to insert the record into the database, and then display the record in my administration area. What I want to do is to make sure that nobody can put the code in one of the entries, and if they do then to strip out code before its insertion in the database. Anyone know how I can do this? I'm not a coder I just use dreamweavers Insert menu, but I can change the code if somone told me what to do and where.

    Thanks in advance

    Dang - sorry-

    foreach ($_POST as $key-online $value) {}

  • CFIF to the boxes being inserted into the database field car_make.

    Hello, I need help on CFIF for the boxes being inserted into the database field car_make.

    At this point, several values is inserted in the car_make field. I would like to only have one value depending on what is checked in the box.

    Thank you

    Here's what I mean. I would like to know if it is is not clear.

    CFIF
    If Honda is checked then Honda value is inserted in the field car_Make

    If if Toyota is checked then Toyota value is inserted in the field car_Make


    If If Subaru is checked then Subaru value is inserted in the field car_Make


    You CAN, of course, but not without being fluent in javascript. Is there a particular reason you want to use checkboxes versus radio buttons?

    From an interface point of view, its generally not a good idea to change the behaviours expected of HTML form elements. If users see an option button, they assume generally that it will allow only 1 choice. If they are presented with a box, they could very easily be expected they could select more than 1.

  • Error 0x80040E57 then store the date and time to the database

    Hello

    I'm using Labview 2009 for storing the date & time of microsoft database but I get an error (0x80040E57), which specifies that the field is too small to accept the amount of data, I'm trying to enter. A screenshot of the error message and the VI is put in an attachment. Please suggest a solution for this.

    Thank you

    Guilhem

    Hi Marion,.

    I looked a bit in question and found that the error occurs when one of your columns of database is too small to contain the data that you are trying to (see page 236 of this PDF). The data initially a problem is going to be one of the strings that you are trying to insert. I guess you circled in red is the origin of the problem.

    I found a client who had a very similar problem. Here's how, he said, he has solved this problem:

    I found the problem. The problem that you said was in the database. The "Date" column in the database table has been specified to enter 9 characters only. So when I ran the program on 12/02/2011 it ran for a week until 2011-12-09 23:59. So 2 to December 9, the total for the date format characters were 9 (if you add them) but as soon as the date changed to 12/10/2011 at 12:00 midnight the total number of characters were 10 (more than 9) and that's why he stopped at 23:59 on 09/12/2011. I changed the number of characters to 10 now and its working very well.

    Then you can check your database to make sure that it is large enough to accept this entry.

    I hope this helps.

    Trey Keown

    Technical sales engineer

    National Instruments

  • FORMS: Insert to the DATABASE + email

    I recently chose to recreate a site that was removed from the use of our home owner Association. This site has been able to do the two things that I've been able to accomplish a. These two things:

    (1) insert form user data into a database (I CAN DO THIS RIGHT!)
    (2) send an email containing the data of the form to the user (and group)

    Is there a way to accomplish both of these tasks using a DW coding (again, I said, I can INSERT data into the database)

    Thanks for ANY help here!

    Glen the computer guy

    MD...

    Through the use of forms To Go, you have responded with the answer to my question (to solve in BOTH cases).

    I think it's true (that you offered the solution)... I go to their website, but does not see that the added value on Forms To Go mentioned anything on the database insertion process. I sent a query to ask this question even (such as presented here by me at the get-go)... I'll see what they respond with. And, given that a FREE TRIAL of forms To Go, I'll do this and investigate on the spot.

    Thanks also to mock me with your hope of do not jump me on you...

    Funny, inherently we all know where we are 'on the topic' and helping to resolve the problem indicated. Most likely, read you my first response "jump" and determined that I was reacting to the loss of time since I said I had resolved on tasks, but wanted a solution to both... then again, maybe that I could have written it more clearly?

    In any case, for now (and I'll be followed on that as soon as I tried it - forms to go), it's the answer that seems more 'right on!' me.

    Thank you!!

    Glen the computer guy

  • How can we check that the data already exist in the database

    Hi friends

    I'm trying to create a procedure for adding clients in the database with the customer id as input parameter... but if the customer details database already exists that I would update this detail and is not in the database I want to add this detail in the database... How could I do that...

    any help would be appreciated

    Thank you
    Rommy

    Hello

    If your condition is to add to a table, and if the record exists in the other table, the merge statement does not work

    Example (Please check the column name and the parameter names). I do not commit or rollback because I do not know if you control the transaction within this procedure or outside it.

    CREATE OR REPLACE PROCEDURE add_cust(I_CUST_ID        IN VARCHAR2,
                                         I_CUST_F_NAME    IN VARCHAR2,
                                         I_CUST_L_NAME    IN VARCHAR2,
                                         I_CUST_ADD       IN VARCHAR2,
                                         I_CUST_CITY      IN VARCHAR2,
                                         I_CUST_STATE     IN VARCHAR2,
                                         I_CUST_ZIP       IN VARCHAR2,
                                         I_CUST_DOB       IN DATE,
                                         I_CUST_          IN VARCHAR2,
                                         I_CUST_ACCT_TYPE IN VARCHAR2,
                                         I_START_BAL      IN NUMBER) IS
    BEGIN
       INSERT INTO CUSTOMERS C
          (CUST_ID,
           CUST_F_NAME,
           CUST_L_NAME,
           CUST_ADD,
           CUST_CITY,
           CUST_STATE,
           CUST_ZIP,
           CUST_DOB,
           CUST_)
       VALUES
          (I_CUST_ID,
           I_CUST_F_NAME,
           I_CUST_L_NAME,
           I_CUST_ADD,
           I_CUST_CITY,
           I_CUST_STATE,
           I_CUST_ZIP,
           I_CUST_DOB,
           I_CUST_);
    
    EXCEPTION
       WHEN DUP_VAL_ON_INDEX THEN
          INSERT INTO CUSTOMER_ACCT
             (CUST_ID,
              CUST_ACCT_NO,
              cust_acct_type)
          VALUES
             (I_CUST_ID,
              CUST_ACCT_SEQ.NEXTVAL, -- CUST_ACCT_SEQ is a sequence, isn't?
              I_CUST_ACCT_TYPE);
    
    END add_cust;
    

    Kind regards

  • time data between extraction using the database

    Hello

    I do datalogging with data 1 min interval, the logg data upward at 3 days, was preparing I use sql server, now I can't able to insert and extract data also plenty fast.  but I need to recover the data in the time specified and also a lot of wise.  could you tell me how to implement this?

    I downloaded a few vi ni.com, but his does not work...

    send me if possible example vi

    Hi DP Baro,

    See this link please

    http://vyaskn.tripod.com/searching_date_time_values.htm

    It shows how you can find date and time values. You can combine them. I don't really know if you can solve the interval of 5 minutes with her, but you can get definitifly the beach, you need. You can then filter the latest data in LabVIEW.

    See also this link for your second question

    http://www.mssqlcity.com/articles/compare/sql_server_vs_access.htm

    Mike

  • Is it possible to recover a database with the copy of data files (cp), while the database has been opened?

    Hello

    We know we need to do a backup of an oracle database by using the appropriate tool, in most cases the rman. But we have in our society, a person who helps us with the backup of all the databases oracle we have. Thus, in addition to the rman backups, we do a copy (cp) with the open database of all files in oracle database, (without start backup) including of course spfile, controlfile, etc.. My question is: can recover us my database using this copied data files? or are we just wasting disk space on our backup environment?

    Kind regards
    Melo.

    We're doing a copy (cp) with the open database of all files in oracle database, (without start backup) including of course spfile, controlfile, etc..

    As EdStevens said, it's essentially a backup without value. When you copy files from a backup ' hot', there may be inconsistencies in the blocks of the file as transactions actively edit these blocks while the copy is made. Mechanism of Oracle backups hot managed by users is to put the database or tablespace in backup mode, copy the files, and then the end backup mode. Without this mechanism, the chances of being able to restore from this backup are very, very thin.

    My question is: can recover us my database using this copied data files?

    My question is... have you tested recovery? If the recovery has been piloted, then called the answer to this question. Please read the end of this blog post for more information:

    Blog of Peasland before necessary recovery database backups"

    See you soon,.
    Brian

  • Can we read data present clob in the database oracle by BPEL

    Hi all

    Please let me know or help me understand if we read clob data (excel file) present in the database of BPEL?

    TIA

    Try this one,

    Re: Reading Xml file of the clob in the staging table column

    It will be useful,

  • No form data is not in the database

    Hi-

    I created a simple web form that allows the user to add new records to the database, however, only one of the text fields appear in the database. I'm not sure what I did wrong. Can anyone help? Thank you. (See code below)

    ----

    < body >

    Add a record < h3 > < / h3 >

    < do action = "add_record.php" method = "post" name = "Add record" > "
    < input name = "Title" type = value "text" = "Title" size = "100" / > < input name = "Author" type = value "text" = "Author" size = "125" / > < input name = "Year" type = "text" value = "Year" size = "50" / > < input name = "Editor" type = "text" = "Publisher" value / > < input name = "ebook" type = "text" value = "Ebook" / > < input name = "Ranking of Amazon" type = "text" = "Rank" value / >
    < p > < input name = "Submit" type = "submit" / > < / p >
    < / make >

    < / body >
    < / html >

    Your code looks OK, although there is a dollar sign disappeared off the coast of amazon_rank at the end:

    $insert = mysql_query ("INSERT INTO mydatabase.idxbooks (book_title, author, year, Publisher, ebook, amazon_rank) VALUES ('$book_title', '$author', '$year', '$publisher', '$ebook', 'amazon_rank') '");

    This should be:

    $insert=mysql_query("INSERT INTO mydatabase.idxbooks
    (book_title, author, year, publisher, ebook, amazon_rank)
    VALUES ('$book_title', '$author', '$year', '$publisher',
            '$ebook', '$amazon_rank')");
    
  • Data synchronization after restoring the database to the Source or target

    Hi DBAs,

    I've implemented replication unidirectional flow at the level of transactional database to the database schema (excluding some tables). It works very well without any problems after doing the tuning of flow with the help of health check scripts. My question is if some reasons, if I have to recover to the level of the database on the database Source then I need rebuild flows from scratch? Database size is close to 2 TB and after recovery, even using the pump data at the same time, it could take hours and also the source won't be available even after the recovery (data pump running job - if the source is online, then I was getting ORA-01555 errors and work was not).

    Please notify by above circumstances what is the best way to re - synchronize data between the source and target.

    Thank you
    -Samar-

    I would export of the datadict (build) once again, just to avoid any MVDD, something to do directly after the restoration of the DB,.
    because I'm not sure from the perception of this restoration DB in terms of DBID. Have you checked in rman if source db is considered to be the epitome?

    Then restart what are the messages in the target error queues. I think that you will have problems to move the first_scn
    due to differences on some YVERT in source/target system.logmnr_restart_ckpt$. system will think it has holes.
    You may need to manually remove a bunch of lines to allow the flow to jump on the fate of the YVERT
    that have been sent and are not present in the source system.logmnr_restart_ckpt$

  • Insert in the database

    Hello
    I'm a product of the table and the table structure is
    prod_id  varchar2(50),
    prod_name varchar2(1000)
    I have a form based on this table

    and a button on the form and there is a checkbox on the form

    check box value when unchekced = NULL
    If it is enabled = SMALL

    and the code for my button is
    When button pressed
    SELECT prod_id_seq_blank.NEXTVAL INTO :product.prod_id FROM DUAL;
    and I have a backup button on this form, the code is commit;

    I want when I press the button and then I want to enter two codes in the database a sequence like 1010 and the second is 1010Small

    Please guide me

    Thanks and greetings
    Vikas Singhal

    Vikas,

    To do this, as I said in the previous post, write in the WHEN BUTTON PRESSED trigger

    SELECT PROD_ID_SEQ_BLANK.NEXTVAL INTO :PRODUCT.PROD_ID FROM DUAL;
    

    And to relax WHEN--BUTTON of the Save button, write.

         IF UPPER(:PRODUCT.) = 'SMALL' THEN
              INSERT INTO PRODUCT(PROD_ID, PROD_NAME) VALUES(:PRODUCT.PROD_ID || 'small',  :PRODUCT.PROD_NAME);
         END IF;
         COMMIT;
    

    Now the second record will insert only when the box is checked. +(I forgot to Write the If statement in the pervious post) +.

    Kind regards

    Manu.

    If my response or response from another person was helpful, please mark accordingly

  • increase the value of minute in 14 minutes, while the data is inserted into the table

    Hello

    I'm having the asp page that connects with the DB to insert values into the table. One column is date data type. Value from this asp page must be incremented to 14 minutes before be inserted into the table.

    How can I do this?
    sqlG="INSERT INTO AEMU " &_
                                                      " (MSISDN,X,Y,TIME_STAMP,REQ_ID, " &_
                                                      "  COUNTRY_G)" &_
                                                      " VALUES " &_
                                                      "('"& msid &"'," &_
                                                      "'" & X & "'," &_
                                                      "' " & Y & " '," &_
                                                      "to_date('" & Day(TrueTimeStamp) & "-" & MonthName(Month(TrueTimeStamp), True) & "-" & Year(TrueTimeStamp) & " " & Hour(TrueTimeStamp) & ":" & Minute(TrueTimeStamp) & ":" & Second(TrueTimeStamp) & "', 'DD-MON-YYYY HH24:MI:SS')," &_
                                                      "' " & req_id & " '," &_
                                                      "'" & CountryName_G & "')"

    Try this way:

    sqlG="INSERT INTO AEMU " &_
         " (MSISDN,X,Y,TIME_STAMP,REQ_ID, " &_
         "  COUNTRY_G)" &_
         " VALUES " &_
         "('"& msid &"'," &_
         "'" & X & "'," &_
         "' " & Y & " '," &_
         "to_date('" & Day(TrueTimeStamp) & "-" & MonthName(Month(TrueTimeStamp), True) & "-" & Year(TrueTimeStamp) & " " & Hour(TrueTimeStamp) & ":" & Minute(TrueTimeStamp) & ":" & Second(TrueTimeStamp) & "', 'DD-MON-YYYY HH24:MI:SS')+14/(24*60)," &_
         "' " & req_id & " '," &_
         "'" & CountryName_G & "')"
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com]

  • Incorrect data that appear on the table of waveform

    I have two cards of waveforms in my vi, two current plot or tension. After that I created an array of data points, I send them to the waveform diagrams. The datapoints are completely incorrect when tracing (scale, no points, no autoscaling) Although, when I export my data to excel, it is perfect. All possible solutions on how to fix this? I have attached my vi for reference (sorry if this is a bit messy). I use the tab control and my problem is statement of the case "Ids vs Vgs.

    You can cheat and use the graph XY Express or use a couple of dice shift registers of Y and build separate X. There is also the example of the graphic called expedition XY.

Maybe you are looking for