Java capture of system date


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Java capture of system date

Hybrid View

  1. #1
    Mike M Guest

    Java capture of system date


    I am trying to capture the system date as part of a form but have not been
    able to get it to capture it the an oracle databse. Is it possible and if
    so can anyone help or point me n the right direction.
    Thanks

  2. #2
    MarkN Guest

    Re: Java capture of system date


    Can you be more specific? How are you trying to do this and how is it failing.


    Oracle (as can most databases) can generate a system date.


    "Mike M" <mike.r.miller@marshpm.com> wrote:
    >
    >I am trying to capture the system date as part of a form but have not been
    >able to get it to capture it the an oracle databse. Is it possible and if
    >so can anyone help or point me n the right direction.
    >Thanks



  3. #3
    mike m Guest

    Re: Java capture of system date


    "MarkN" <java.@127.0.0.1> wrote:
    >
    >Can you be more specific? How are you trying to do this and how is it failing.
    >
    >
    >Oracle (as can most databases) can generate a system date.
    >
    >
    >"Mike M" <mike.r.miller@marshpm.com> wrote:
    >>
    >>I am trying to capture the system date as part of a form but have not been
    >>able to get it to capture it the an oracle databse. Is it possible and

    if
    >>so can anyone help or point me n the right direction.
    >>Thanks

    >

    I'm using a jsp page to update a oracle database. For lack of expertise,
    I'm not able to create the correct syntax for getting the current date only
    an have it populate the database? This make any sense?


  4. #4
    MarkN Guest

    Re: Java capture of system date


    Mike,
    <SoapBox> If you are learning Java I would suggest you don't start with
    JSP's. Also, updating databases directly from JSP's is not a good thing.
    </SoapBox>

    Here is some Java code to get the current date.

    <Code>
    java.util.Calendar dateCreated = java.util.Calendar.getInstance();
    java.text.DateFormat df = new java.text.SimpleDateFormat("MM/dd/yyyy");
    String formatted_date = df.format(dateCreated.getTime());
    </Code>

    You will need to replace the format with the one Oracle expects. Depending
    on the db field type it may need to include a time format.

    BTW, I got it by going to www.google.com and typing in "java current date".
    It was the 4th main link down.



  5. #5
    Guest

    Re: Java capture of system date


    "MarkN" <java.@127.0.0.1> wrote:
    >
    >Mike,
    > <SoapBox> If you are learning Java I would suggest you don't start with
    >JSP's. Also, updating databases directly from JSP's is not a good thing.
    ></SoapBox>
    >
    > Here is some Java code to get the current date.
    >
    ><Code>
    >java.util.Calendar dateCreated = java.util.Calendar.getInstance();
    >java.text.DateFormat df = new java.text.SimpleDateFormat("MM/dd/yyyy");
    >String formatted_date = df.format(dateCreated.getTime());
    ></Code>
    >
    >You will need to replace the format with the one Oracle expects. Depending
    >on the db field type it may need to include a time format.
    >
    >BTW, I got it by going to www.google.com and typing in "java current date".
    > It was the 4th main link down.
    >
    >Mark thanks for the info. And the words of wisdom.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center