Re: Update statements.
- From: David Harper <devnull@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 25 May 2006 18:38:35 GMT
morc wrote:
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();
}
It would be helpful if you could tell us
(a) what type of database server your program is talking to? Is it Oracle? Is it MySQL? Or is it something else? What?
(b) what the stack trace looks like.
You might also want to consider using a prepared statement, in order to avoid putting quotes directly into the query string.
David Harper
Cambridge, England
.
- References:
- Update statements.
- From: morc
- Update statements.
- Prev by Date: Re: Update statements.
- Next by Date: To hibernate or not to hibernate?
- Previous by thread: Re: Update statements.
- Next by thread: To hibernate or not to hibernate?
- Index(es):
Relevant Pages
|
|