Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC Date Issues

Status
Not open for further replies.

minkusz

Programmer
Sep 4, 2001
2
US
I am having trouble inserting a date value into an Access DB using JDBC. My Access field is of type Date/Time, with short date format. All my references say to use the java.sql.Date class to do this. Is this conflicting with using the Short Date format in Access? I have tried almost every variation I can think of. Please help.

insert into rest_totals (name,Service_Charges,Tickets,Net_Sales,Total_Sales,Date) VALUES ('Baoding',2, 5,182.33,200.00,'2001-08-14')

After getting to this point once I started over, coding and testing field by field, to find out where the error was. Everything worked fine until I added the Date field. Any suggestions?
 
I tried this and I get the same result. An exception is thrown saying I have a syntax error in my insert into statement. Either way, thanks for your input.
 
Rename your some of the column names like "name"&"Date" as to some other names " cus_name" ,"today_date"...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top