aspose file tools*
The moose likes JDBC and the fly likes Updating database from Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Updating database from Servlet" Watch "Updating database from Servlet" New topic
Author

Updating database from Servlet

rk t
Greenhorn

Joined: May 09, 2001
Posts: 2
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

Joined: May 09, 2001
Posts: 2
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

Joined: Jan 07, 1999
Posts: 6920
"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.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Smita Tyagi
Greenhorn

Joined: May 09, 2001
Posts: 21
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
 
Don't get me started about those stupid light bulbs.
 
subject: Updating database from Servlet