Ragini I already send the jsp pages check. if not getting copy from here
page1.jsp
--------------
<html>
<body>
<form action="page2.jsp">
<input type="text" name="srch">
<input type="submit" value="submit">
</form>
</body>
</html>
page2.jsp
------------
<%@ page import="com.Test2" %>
<%@page import="java.sql.Connection"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<html>
<body>
<%
String name = request.getParameter("srch");
String srch = "select name from Mytable where name LIKE '%" + name + "%'";
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:
mysql://localhost:3306/testing";, "root", "");
System.out.print(name);
Test2 test2 = new Test2();
test2.setString(name);
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(srch);
if(!rs.next()){
out.println("No Record Found");
}else{
rs = stmt.executeQuery(srch);
while(rs.next()){
out.println(rs.getString("name"));
}
}
}catch(Exception ex){
System.out.println("Exception");
}
%>
</body>
</html>
Are you getting SCJP material or not;
Thanks
Rajanikant