Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases 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 and Relational Databases
Bookmark "Updating database from Servlet" Watch "Updating database from Servlet" New topic

Updating database from Servlet

rk t

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

Joined: May 09, 2001
Posts: 2
I forgot to give the URl.
The counter applet works with already existing data.
The update doesnot work.
Frank Carver

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 . 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.

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

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.
I agree. Here's the link:
subject: Updating database from Servlet
It's not a secret anymore!