First of all check your query. Always print it before you run it and see what is going on. In this case you have this:
"select *from student where no=' " +num+" ' ";
Can you see the blank spaces where you have the quotes. Also you need a space at the '*'. This is what you execute:
select *from student where no=' 1 '
You need this:
select * from student where no='1' "select * from student where no='" +num+"' ";
Or since 'no' is a number you can leave it like this:
select * from student where no=1 : "select * from student where no="+num;
And before you continue, delete all that code from your jsp. Put all tha code in a method in a seperate class and call that method:
<%@ page import="java.sql.*" %>
<html>
<BODY style="background-color:SteelBlue">
<form>
<table border="1">
<tr><th>No</th><th>Name</th><th>qual</th></tr>
<%
int num=Integer.parseInt(request.getParameter("no")); // no is student id taken from
/*
Call a method with argument the num that returns the student. Crerate a Student class with attributes the columns of the table with get/set methods
*/
Student st = yourClassInstance.getStudentByNum(num);
<table cellpadding="15" border="1" style="background-color: #ffffcc;">
<tr><td>No:</td><td>Name:</td><td>Qualification:</td></tr>
<%
// if no student found (rs.next==false then return null) an example at the end
if (st!=null)
{
%>
<tr><td><input type="text" name="no" value="<%=st.getNo()%>" ></td>
<td><input type="text" name="no" value="<%=st.getName()%>" ></td>
<td><input type="text" name="no" value="<%=st.getQual%>"></td></tr>
<%
}%>
</table>
</form>
<form action="view.html" method="get" ><input type="submit" value="Go Home"/></form>
</body>
</html>
Also at the search.jsp you have the input texts to have the same name:
name="no" value="<%=st.getNo()%>" >
name="no" value="<%=st.getName()%>" >
name="no" value="<%=st.getQual%>">
Use a different name or since you don't a form to submit them don't user input text at all:
<tr>
<td><%=st.getNo()%></td>
<td><%=st.getName()%></td>
<td><%=st.getQual%></td>
</tr>
// Example of the new method you will create. Fill in the blanks
Student st = null;
// call the query
if (rs.next()) {
st = new Stusent();
st.set....
st.set
...
}
return st; // if no student found the st will be null