• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sql date

 
Aneresia White
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to get the day, month and year from combo boxes and making an update in my database after this date. I tried something like this:

can is the combo box for year, czi for day and cluna for month.
It doesn't work like this, I receive an error. I think it should be something else instead of (String).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aneresia White:
I receive an error.

What was the error? Sharing this information will make you more likely to get a useful reply.
 
Jaya Latha
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Iam Jaya.The problem you mentioned is not the reason why the code is failing.Type casting is possible.They are convertible types.There may be some other reason for the failure.Please give more details.
 
Aneresia White
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this is the error:

but the syntax is ok I already verify it in sql. if I put (Date) instead of (String) I don't get any errors but the update is not working when I look in the database.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a space between 'where' and 'datav' - and replace the last 'where' with an 'and'.

Normally you will have saved the date as a DATE or TIMESTAMP field in the database, and in Java you will pass the argument to the Statement as a java.sql.Date
[ December 31, 2008: Message edited by: Rene Larsen ]
 
Aneresia White
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You were right about the space between those 2 ) How could I missed that. That's funny. But the last where it's ok, it's what I need it. Thank you.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic