• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to delete the row from the Database by using while loop in servlet

 
Greenhorn
Posts: 5
Oracle Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir/Madam,

I am trying to delete the one user data in the Oracle SQL server database by using Servlet program (Tomcat server).

In Database table have 6 users details are there.

Table name is "JDUSER" and columns are USERS (Char), PASS (Varchar2) and CODE (Varchar2). I am trying to delete 4th user details.

While loop is not terminate, in while loop why If condition not working it checking until end of the table and gives else black statement. So what is my mistake and please give the solution to me.

My HTML code is:




My Database table is:



My JavaServlet Program is:




So finally where is my mistake and in while loop If condition true even though if loop not working.
i am given 4th usre details in HTML page. Please give me solution.

Mail ID : [email protected]
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

please check your delete query.

the correct syntax is delete from table where fieldname='value';

once query is modified, hope it will delete the row from the Database

thanks.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

As per the Good Guidelines All ways You Should Not write any DataBase Related Code in your Servlet.
follow this...
All way The Request Should received By Servelt And it need to Call Any Back end Java Classes Normally Called As Beans(Spring Beans/EJB Beans).
and get The Data from the Beans need to Forward Any jsp page for View Purpose


 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic