Home » Developer & Programmer » JDeveloper, Java & XML » pls help!! for inserting date in oracle database.
pls help!! for inserting date in oracle database. [message #457379] Mon, 24 May 2010 02:49 Go to next message
jackjosh_in
Messages: 2
Registered: May 2010
Location: mumbai
Junior Member
Hi,all
following is the java code for parsing date
------------------------------------
import java.text.SimpleDateFormat;

String dd = "2006-10-20T1350"

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HHmm");
Date now = new Date();

sdf.parse( dd );
------------------------------------
iam getting following outptut

Fri Oct 20 13:50:00 GMT+05:30 2006


How to insert above date in oracle database. pls help iam new
Re: pls help!! for inserting date in oracle database. [message #457400 is a reply to message #457379] Mon, 24 May 2010 04:31 Go to previous messageGo to next message
Michel Cadot
Messages: 66636
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
insert into mytable (mydatecolumn) values (to_date(?,'YYYY-MM-DD"T"HH24MI'));


And then bind "dd".

Regards
Michel

[Edit: Add code tags)

[Updated on: Mon, 24 May 2010 06:16]

Report message to a moderator

Re: pls help!! for inserting date in oracle database. [message #457406 is a reply to message #457400] Mon, 24 May 2010 05:43 Go to previous message
jackjosh_in
Messages: 2
Registered: May 2010
Location: mumbai
Junior Member
Thank u very much Smile
Previous Topic: XML parsing
Next Topic: SetPrompt function of SortableHeader is not displaying the column header
Goto Forum:
  


Current Time: Mon Oct 14 22:34:35 CDT 2019