Aadi Droid
Aadi Droid

Reputation: 1739

MySQL Database not updating

Using java to connect to a mySQL database, if I use a update query like

Update <table_name> set SID='143' where SATR='temp';

and query.execute() return two, that is two entries with SATR as 'temp', but if I check the database no change !

Upvotes: 0

Views: 116

Answers (2)

Balaswamy Vaddeman
Balaswamy Vaddeman

Reputation: 8530

If you are not getting any exceptions,you may call commit() method.

auto-commit option may be off.

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1500635

Have you turned off auto-commit but forgotten to explicitly call commit() by any chance?

Upvotes: 4

Related Questions