File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Incorrect Syntax near Watch "Incorrect Syntax near New topic

Incorrect Syntax near 'Contribution'

Mahendra Kariya

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

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

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".
I agree. Here's the link:
subject: Incorrect Syntax near 'Contribution'
It's not a secret anymore!