public boolean addItem(String barcode, String style, String colour,
String size, String qty, String store){
boolean complete = false;
String addItem = "INSERT INTO items (barcode, style, colour, size,
qty, store) VALUES
('"+barcode+"','"+style+"','"+colour+"','"+size+"','"+qty+"','"+store+"')";
Statement stmnt = null;
System.out.println(addItem);
try {
stmnt = conn01.createStatement();
stmnt.executeUpdate(addItem);
//stmnt.execute(addItem);
complete = true;
} catch (SQLException e) {
e.printStackTrace();
}
return complete;
}
-----The statement works but the executeUpdate isnt updating the
database, when i use the same query directly in access it works and the
connection works for other queries, that modify the information of an
already existant row of information, but for this im not getting any
errors its just not updating my database.
Any ideas on what it could be?
Any help would be greatly appreciated.
Thank you, and ignore last message i fixed that problem
ducnbyu - 26 May 2006 17:35 GMT
Do you need a commit?
lalalala - 26 May 2006 17:41 GMT
Well for previous update statements it wasnt required (SQL commit), and
they updated succesfully. Although perhaps it is because in this case
i'm trying to insert a new row in the table.