Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DATE

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I'm trying to assign a date to a column in a oracle table. The format of the date I'm trying to pass is 06/01/2005. I have looked at the api for DATE, but can't figure out how to get the date of 06/01/2005 into the field on the table, which is defined as DATE.
Could somebody help me with this problem?

Here's what I have so far:

sql = "insert into table1(acct_id,date1,date2) values(?,?,?)"

String a = null;
String d1 = "06/01/2005";
String d2 = "06/01/2006";

stmt.setString(1,a);
stmt.setDate(2,d1);
stmt.setDate(3,d2);
 
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic