-
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
-
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
-
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?
-
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.
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks