The Artima Developer Community
Sponsored Link

Java Answers Forum
java Date String to Oracle Date column

1 reply on 1 page. Most recent reply: Mar 8, 2003 3:30 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Harry Solomon

Posts: 1
Nickname: harryj
Registered: Mar, 2003

java Date String to Oracle Date column Posted: Mar 7, 2003 9:35 PM
Reply to this message Reply
Advertisement
Can someone tell me how to format/convert a java date String to an Oracle Date data type in the mask of dd-MON-yy so I can executeUpdate() an insert statement. Or tell me where I can find the appropriate documentation.
Thanks,
HarryJ


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: java Date String to Oracle Date column Posted: Mar 8, 2003 3:30 PM
Reply to this message Reply
java.util.Calendar calendar = java.util.Calendar.getInstance(); 
int day = calendar.get(Calendar.DATE);
int month = 1 + calendar.get(Calendar.MONTH);
int year = calendar.get(Calendar.YEAR);
/* dd-MON-yy */
String oracleDateString = String.valueOf(day) + "-" + String.valueOf(month) + "-" + String.valueOf(year);

Flat View: This topic has 1 reply on 1 page
Topic: java with maple help (runtime) Previous Topic   Next Topic Topic: Design UML !

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use