Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Excecuting Update Statements

0 views
Skip to first unread message

morc

unread,
May 25, 2006, 10:52:09 AM5/25/06
to
hey im having a little bit of trouble excecuting my update statsments.
I chekd in access directly and am sure that there is no errors in my
SQL.

this is the code i used. The connection is fine its been tested before.

String remove = "UPDATE items SET qty = qty - 1 WHERE store =
'"+from+"' and barcode ='"+barcode+"'";


Statement stmt = null;


try {
stmt = conn01.createStatement();
stmt.executeUpdate(remove);
} catch (SQLException e) {
e.printStackTrace();
}


If anyone knows what the error is it would be greatly appreciated.
thanks
-morc

Oliver Wong

unread,
May 25, 2006, 11:39:56 AM5/25/06
to

"morc" <questio...@msn.com> wrote in message
news:1148568729.2...@g10g2000cwb.googlegroups.com...

See
http://riters.com/JINX/index.cgi/Suggestions_20for_20Asking_20Questions_20on_20Newsgroups#RepeatErrorsExactly

Also, you're leaving yourself vulnerable to SQL injection attacks. See
http://nebupookins.net/entry.php?id=334 You'll probably want to google for
"Prepared Statements".

- Oliver

0 new messages