This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet code for updating data in database

 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi people.. i have a question related to an online bus ticket booking system.... Suppose a client gives his information in a form...(like his name, credit card number , address, email etc.) .. also he provides information on how many tickets he want.. Now suppose we have in our database table the total available tickets = 30, and if the customer buys 1 ticket, the database should be updated dynamically from the servlet , shouldn't it ?? I mean now the currently available tickets should be = 29 after posting the form .... What code is required to achieve the above... I am scratching my head... Please help me.....
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll be moving this to the JDBC firm as this is a database question, not a servlet question.

And, in a properly structure web app, the servlet would delegate this task to a class in the Model layer.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33697
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read about JDBC yet? If so, what part are you stuck on? Connecting to the database? Writing a SQL statement to decrement the count?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic