I'm doing updates to records thru Java and JDBC but the timestamp field doesn't update.
An example: Address has only two fields Line1 - varchar(40) UpdateTime - timestamp
ResultSet rs = this.doQuery("SELECT * FROM address WHERE address.key = 1", true); rs.updateString("Line1", "street addr"); rs.updateRow(); The above does not update the UpdateTime timestamp.
If however I do a query "Update address set line1 = 'street addr' where address.key = 1" Then the timestamp is updated.
Originally posted by adeel ansari: may be this mySQL driver problem. refer this
Hi adeel,
The problem you refer to is not really a problem but due to the type of table selected which does not have transaction support.
It would appear as if the ResultSet object is just a staging area that keeps tabs on all the objects retrieved and re-writes them when updating. So if I don't update timestamp it just re-writes the old value.
I don't want this to happen and I don't want to update the timestamp on the client as the time may not be the same as the server. Is there a way to force the timestamp field to be updated or a way to remove it from the rowset?
Jean
Jean Bodemer
Greenhorn
Joined: Apr 20, 2004
Posts: 3
posted
0
I managed to get past this issue by setting the timestamp = null before the updateRow() statement