wood burning stoves 2.0*
The moose likes JDBC and the fly likes Terminated Insert. 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 "Terminated Insert." Watch "Terminated Insert." New topic
Author

Terminated Insert.

Johnny Woosh
Greenhorn

Joined: May 16, 2005
Posts: 10
hello there. im having the following error.



Im supposed to do insertion into database.everything is inserted until this line is encountered.the insertion is actually terminated due to the round brackets.how do i actually escape this round bracket so that insertion can continue? any help will be appreciated. thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Can you show us the code you use to run this SQL?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Johnny Woosh
Greenhorn

Joined: May 16, 2005
Posts: 10
sure..

Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


You need to make sure when you parse the column name you correctly substring it to a valid column name. Your file must have something like this:

in it, and you need "straight_line=". If you know how the file will always be formatted, you can make the assumption you do (i.e. that a valid field name exists 8 characters in to a line). For a better way of doing this, you could validate what you get before trying to run any SQL with a regular expression. Or you could get the column name with a regular expression in the first place.

(By the way, are you sure you want to update a table with SQL without any where clause? I don't know if this was what you intended - perhaps it was - but that SQL is going to update every row in the table).
 
wood burning stoves
 
subject: Terminated Insert.
 
Similar Threads
currentTimeMillis() returning wrong value ?
Tree creation problem
Unable to execute insertion!
Creating classes
Getting wrong auto_increment number when inserting into database table.