954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Adding a deleting rows

Business Processes
<%
Connection conn = null;
ResultSet rs1 = null;
Statement stmt = null;
ResultSetMetaData rsmd = null;
int columns=0;
String query="select bpname from businessprocessinfo;";


Class.forName("org.postgresql.Driver");
conn = DriverManager.getConnection("jdbc:postgresql://192.168.128.150:5432/thirdeye", "postgres", "postgres");
stmt = conn.createStatement();
rs1 = stmt.executeQuery(query);



while (rs1.next())
{%>




<%= rs1.getString(1) %>








<%
}
%>






Name






Description





Add Jobs















Name






Description





Add Steps











saswati_mishra
Newbie Poster
15 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

1. Please use the hash sign "#" to insert any code in your post. The function is there for a reason.
2. Ofcourse the thing you try to do it doesn't work. You did not finishe it. From your JSP page you call servlet which is supposed to delete some data and then nothing...
What you want to do is from your JSP call servlet. Pass a request for processing, process the request, update your session bean or what ever you use store data from database. After these you call back your JSP page and show updated view.

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Hi,

String query="Delete from businessprocessinfo where bpname=("request.getParameter('bpname')":P";

Saswati



Have you tried this in SQL, because you are trying to access a variable within a string without catenation (spelling?).

sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You