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
Printable View
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
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
"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?
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.
"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.