This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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'
Similar Threads
SCJD I passed...I think
Syntax Error
SQL Dates
entityManager produces incorrect SQL when using limit
Getting SQL Exception although stored procedure is correct!!!