Hi there,
I'm getting stuck with the following procedure using prepared statements..
it works just fine if I use a normal statement. I need to pass a prepared
statement because I need to pass a valriable to the query. It does not
return any records!
Statement stmt = con1.createStatement();
String query = "Select * from SW_Customer where swName = ?";
PreparedStatement ps = con1.prepareStatement(query);
ps.setString(1,tname);
ResultSet rs = ps.executeQuery();
while (rs.next()){
String name = rs.getString(1);
out.println("Value of field = " + rs.getString("swName"));
out.println("Value of field = " + name);
}
Any help will be appreciated
Thanks
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com