This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
before I go on...
Now I feel a little better..for the past hour I've been trying to insert a freaking date into the database...a date for crying out loud..
my lecturer stored it as a string...when i convert it into a string to debug i display and it displays fine....to insert it..always a freaking exception
I changed the format to Date/Time in the database..and still no freaking luck..aaargh
So I'm hoping the jsp gods in this forum can help me out here...how can I solve this problem?
How to insert a date into a database?
Btw i am using Access..and I have no choice..i gotta use it..
any help appreciated thanks.
Dates and SQL can be a nightmare at time (which format does the server require? month-date-year? day-month-year? will year-month-date always work?), so I always use a PreparedStatement with its setTime, setDate and setTimestamp methods.
Hey thanks for replying..
@Bear I am trying to use JSTL and JSP..that's why I thought it would be in that forum...sorry.
One of many attempts
The format is dd-mm-yyyy
@Rob I will google that PreparedStatement and see if I can resolve the problem thanks.
Joined: Apr 03, 2011
mmn...I think I resolved the problem now..
I used the same code I had..but it appears that one of the fields is a primary key...as a result inserting the same primary twice into database throws the exception.I
It's ridiculous..I would have thought a simple error to suffice...I think I can make my way from here now..if not i'll be back ha ha