File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Syntax error in INSERT statement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Syntax error in INSERT statement" Watch "Syntax error in INSERT statement" New topic
Author

Syntax error in INSERT statement

K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 66


im getting syn
"java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driv
er] Syntax error in INSERT INTO statement."

while running the above. code. any body help me with this problem
[ July 21, 2006: Message edited by: K Vidhyakar ]
Zip Ped
Ranch Hand

Joined: Jul 26, 2005
Posts: 336
Check your field data types (such as eid,timeIn, timeOut). Are all your field of the type Text in your table?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16479
    
    2

"Date" is a reserved word in MS Access (which I guess you may be using) and probably in other databases too. Changing the column name to something more precise would, as a side effect, improve your database design.
K Vidhyakar
Ranch Hand

Joined: Jul 10, 2005
Posts: 66
they i changed the field name date to edate. now its working.
thanks a lot friends.
amit bhadre
Ranch Hand

Joined: Jan 23, 2006
Posts: 124
check the DNS name which should be created as company while connecting to MS sql server.


Thanks advance who ever answers this question.


regards
amit bhadre
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Syntax error in INSERT statement
 
Similar Threads
Database Connectivity
JDBC-ODBC
Error in insert into
insert command is not working.
INSERT problem