Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating database from Servlet

 
rk t
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai
I have thsi vague problem.
I made a simple phone book whick queries number according to name. It worked until I wanted to add counter to it.
When ever I click it also should update a Counter table in a database. I made a class for the updation process.
Its called UpdatePhoneBookCounter(Connection con).
First I used it from command line. I passed a connection from another test and also passed a date-string(new Date().toString()) so that it updates the table with date, month, year, day etc.
It works on command line.
But same creation of pdate class passing a connection has spoilt my basic phonebook too.
Is this because I am using the same connection for getting the phonenumber from 1st table and then again using it for updation??? ( I get the connection from another class Oracle Connection which is surely working)
Please help.

------------------
 
rk t
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to give the URl. http://webprojects.cs.tamu.edu:8000/web-ugrad/spring2001/489-3/docs/PhoneBook10WithCounter.html
The counter applet works with already existing data.
The update doesnot work.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"rk t",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
Thanks.
 
Smita Tyagi
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello rk t,
First of all same connection can be used for more than one queries so you can count out that reason for the error. Secondly I tried to reach the link you have given but in vain it is not working. It gives me misspelled URL exception.
Smita
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic