This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am trying to save values to a table in Access, I have 3 threads that update this single table, but it seems to be overwriting the values in the table. Could any of you please guide me on what I am dooing wrong. The code is as follows:
Here are the 3 threads:
Here is the part from the run() where I call the JDBC:
Here is the part where we Update and Read the DB:
Here is the output
Thread : Thread-0 Data from Init_Cell: 0 Data from Final_Cell: 18
Thread : Thread-1 Data from Init_Cell: 4 Data from Final_Cell: 13
Thread : Thread-2 Data from Init_Cell: 7 Data from Final_Cell: 14
When I check the Table in the DB all is see is the last entry of 7 and 14, while the rest are missing!
Your suggestions and support are much appreciated.
[edited to disable smilies] [ December 27, 2004: Message edited by: Jeanne Boyarsky ]
What do you expect to see? Each time the update statement runs, it overwrites the previous values in the table. So after the threads are finished, you would see the results of whatever thread happened to run last.