• Post Reply Bookmark Topic Watch Topic
  • New Topic

delete not working

 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my following code


and following is my servlet code
i have to perform delete operation but its not working
i want to know in the following code

String P_NO = viewList.get(6).toString();
it will going to read which element from the database or it will going to read the fields i have mentioned in the page because i used selected fields from the database
my data base is following



"LASTNAME" VARCHAR2(255 BYTE),
"FIRSTNAME" VARCHAR2(255 BYTE),
"ADDRESS" VARCHAR2(255 BYTE),
"CITY" VARCHAR2(255 BYTE)
"AGE" VARCHAR2(255 BYTE)
"RELATION" VARCHAR2(255 BYTE)
"P_NO" VARCHAR2(255 BYTE)





 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Megha Singhal wrote:in my following code


and following is my servlet code
i have to perform delete operation but its not working
i want to know in the following code

String P_NO = viewList.get(6).toString();
it will going to read which element from the database or it will going to read the fields i have mentioned in the page because i used selected fields from the database
my data base is following



"LASTNAME" VARCHAR2(255 BYTE),
"FIRSTNAME" VARCHAR2(255 BYTE),
"ADDRESS" VARCHAR2(255 BYTE),
"CITY" VARCHAR2(255 BYTE)
"AGE" VARCHAR2(255 BYTE)
"RELATION" VARCHAR2(255 BYTE)
"P_NO" VARCHAR2(255 BYTE)

i have checked the code through view source on delete button function
this is showing the values for deletion
and also following line should be like
not 6 as through 0 it is taking right value for deletion but now the problem is why it is not deleting




 
Swastik Dey
Rancher
Posts: 1686
7
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


It's surprising the above works!! How can an object be compared to a string?
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:

It's surprising the above works!! How can an object be compared to a string?


if i am writing this then also its not working, the problem is not this because same code is working in another program for another table but not working for this ,
i just have one doubt how to pass varchar object like "5674A" can pass through from jsp to servlet through query string like below
 
Swastik Dey
Rancher
Posts: 1686
7
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why it is not deleting is a different issue. But both of your codes are wrong, and it's really surprising how is it working in the other program. An object can neither be compared to a String nor it can be compared to an integer in the way you are doing. As per my understanding what you are trying to check is, arraylist's size is not 0. So, it should have been
 
Megha Singhal
Ranch Hand
Posts: 225
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swastik Dey wrote:Why it is not deleting is a different issue. But both of your codes are wrong, and it's really surprising how is it working in the other program. An object can neither be compared to a String nor it can be compared to an integer in the way you are doing. As per my understanding what you are trying to check is, arraylist's size is not 0. So, it should have been

sorry i was mean this only.
now please tell me why it is not working
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!