Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

please figure this out..  RSS feed

Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone help me sort out this.
i have a search page with 2 input fields name and lastname that generate the next jsp page which displays the matching records and corresponding to them i have given a drop down year menu. Now , on choosing from the year and then clicking on the name the values for that particular year and for that name are generated.
my code is like this:
Connection con=null;
java.sql.Statement stmt=null;
ResultSet rs=null;

con = DriverManager.getConnection("jdbc dbc:mech_iit");
stmt = con.createStatement();
String fname=request.getParameter("fname").toUpperCase();
String lname=request.getParameter("lname").toUpperCase();
String mainquery="";
String subquery="";
int count=0;
String Desg="";

subquery=" upper(fname) like '%"+fname+"%'";

subquery = subquery + " and ";
subquery = subquery + " upper(lname) like '%"+lname+"%'";
mainquery="select fname,lname,Desg,user_login from login where "+subquery+"";

fname = rs.getString("fname");
lname = rs.getString("lname");


<form name="form1" method="post">
<table align="center" border=1 cellspacing=3>
<tr bordercolor="#000000">
<td bgcolor="#FFFFCC" value="name"><a href ="my_page.jsp?user_login=09090"><%=fname+" "+lname %></a></td>
<td bgcolor="#FFFFCC" value="desg"><%=Desg%></td>
<td bgcolor="#FFFFCC"> Year </td>
<td align="middle" bgcolor="#FFFFCC" width="52%">
<select name="year">
<option value="01">2003</option>
<option value="02">2002</option>
<option value="04">2000</option>
<option value="05">1999</option>
<p> </p>
<p> </p>
out.println("<p><b> No Record Found</b></p>");

catch(Exception e)

Wanted to know that in the next page where the user records are generated how do i display the users records on clicking on his name.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!