This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JSP and the fly likes please figure this out.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "please figure this out.." Watch "please figure this out.." New topic

please figure this out..

jyotsana dang
Ranch Hand

Joined: Sep 26, 2003
Posts: 135
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.
I agree. Here's the link:
subject: please figure this out..
It's not a secret anymore!