File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleting single/multiple rows from databse using checkbox

 
Poonam Dhatavkar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i want to delete single/multiple rows from database table on clicking the checkbox, in addition it should first show all the rows and columns.
A part of code i am using is:



Problem with the code is, when i remove 'value="<%= rs.getString("bookid")' in input type, only then it shows whole data (select*from book)
and it deletes a row, bt as data is not shown, we cant predict which row is about to delete.


Also in case of deletion of multiple rows,




i am getting syntax error as==> Syntax error (missing operator) in query expression 'bookid IN()'.

Can somebody help me ??
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the error message, it seems your selected variable is empty.
It is easier if you give us the complete error, exactly as it is logged in the program.
 
Poonam Dhatavkar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Message i gt is "No data found"
 
Poonam Dhatavkar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did some changes in code and database, and now i can delete single row.. bt there is still problem with multiple rows selection and deletion. Is there something wrong with the code ?? like in loops ?
i am not getting any kind of error message.
 
Poonam Dhatavkar
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got the solution.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic