In similar fashion as you query database to see what is available in stock you can link your customer purchase order action(on any website seen as button to "Confirm" after you provided delivery address and payment details) to a method in servlet to take data stored in order form to construct UPDATE query. Query will decrement you stock by certain amount, this would need to be done with sub-queries (query inside query) plus in same time you should also create new entry for new purchase order in different set of tables.
If you are more experienced with database you can even set up procedure for this sort of task.
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
Offline 6,654 posts
since Dec 2004