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 Incorrect Syntax near 'Contribution' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Incorrect Syntax near Watch "Incorrect Syntax near New topic
Author

Incorrect Syntax near 'Contribution'

Mahendra Kariya
Greenhorn

Joined: Aug 25, 2008
Posts: 26


I am using MS SQL Server 2008 as database. I downloaded the JDBC drivers from Microsoft's website.

I am running a query in my program.



This query is working fine sometimes. But when the user load increases, this query is failing. It is generating an exception:


I am not using the word 'Contribution' anywhere. I don't understand why this error is occurring? This doesn't occur every time. ONLY WHEN THERE IS LOAD ON THE SERVER.
How to solve this error?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I don't know the answer but a first thing you must do is in sert the columns into the insert statement
so


this is just much safer code, and may make your problem go away.
Going to discover how to write a FAQ, "the column order isn't reliable".
 
Don't get me started about those stupid light bulbs.
 
subject: Incorrect Syntax near 'Contribution'