• Post Reply 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

IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are using java 1.5 to access a PL/SQL procedure on oracle 9i database (9.2) and we are facing problem with passing the date to pl/sql procedure.
Through JDBC, we have to set this to an object of a procedure whose description is
createdby VARCHAR2(20),
timestamp DATE,
commentText VARCHAR2(1000)
This is how we tried:
Object[3] obj = new Object[3];
obj[0] = ...
obj[1] = ...
obj[2] = new Timestamp(...)// java.sql.Timestamp : doesn't work
obj[2] = "2009-11-17 11:30:21.111111111" // Concatenating fractional seconds: doesn't work
obj[2] = new TIMESTAMP(date).toJdbc(); // oracle.sql.TIMESTAMP : doesn't work

We have used SimpleDateFormat and converted date to the string form and tried to pass it, but still the same error
IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

Please help.

Regards,
PRK
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try something like this



Regards,

Fatih.
 
P Rk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Fatih for the reply.

I tried with this but still the same error.
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String format ="yyyy-MM-dd'T'HH:mm:ss.SSSZ"

Format the date using this formatter and then pass it on to the query

Hope this helps.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic