Good day everyone Please i needs help.This code was used to fetch information from database.
whenever a correct id corresponding to that row is entered at BEANS.JSP ,it will fetch every information from that row.
But the problem am having is that it will retrieve every information on that row for each ID entered but the Image cannot
be retrieve instead it will retrieve image link.Please how do i solve this problem using JSP only without using URL.

Thanks for help.

below is the code
------BEANS.JSP---------

Code:
 <HTML>   
    <HEAD>   
        <TITLE>Database Lookup</TITLE>   
    </HEAD>   
    
    <BODY>   
    <BODY bgcolor="#ffffcc">   
    <center>   
        <font size="7" color="green"> DATA RECOVERY FROM DATABASE</font>   
    <hr size="20" color="green">   
    </center>   
  
  
<center>   
        <FORM ACTION="rice.jsp" METHOD="POST"><fieldset><legend>   
        <font size="5" color="green">   
            PLEASE ENTER YOUR ID  HERE FOR SEARCH </font></legend>   
            <BR>   
            <INPUT TYPE="TEXT" NAME="id" size="40">   
            <BR>   
            <INPUT TYPE="RESET" value="CLEAR MY ACCOUNT" size="40"><INPUT TYPE="SUBMIT" value="SEARCH   MY   ACCOUNT"></fieldset>   
</center>   
  
  
  
        </FORM>   
    </BODY>   
<HTML>

------------------RICE.JSP------------
Code:
<%@ page import="java.sql.*" %>   
<% Class.forName("com.mysql.jdbc.Driver"); %>   
  
<HTML>   
    <HEAD>   
        <TITLE>Fetching Data From a Database</TITLE>   
    </HEAD>   
  
    <BODY>   
  
    <center>   
        <font size="7" color="green">Fetching Data From a Database</font>   
  
    </center>   
  
        <%    
            Connection connection = DriverManager.getConnection(   
                "jdbc:mysql://localhost:3306/money", "root", "root");   
  
            Statement statement = connection.createStatement();   
  
            String email = request.getParameter("email");     
  
            ResultSet resultset =    
                statement.executeQuery("select * from login where id = '" + id + "'") ;    
  
            if(!resultset.next()) {   
                out.println("SORRY, WE COULD NOT GET YOUR INFORMATIONS. ");   
            } else {   
              
        %>   
  
        <TABLE BORDER="1">   
            <TR>   
               <TH>YOUR SURNAME:</TH>   
               <TH>YOUR FIRSTNAME:</TH>   
               <TH>YOUR image:</TH>   
                          </TR>   
           <TR>   
               <TD> <%= resultset.getString(1) %> </TD>   
               <TD> <%= resultset.getString(2) %> </TD>   
               <TD> <img src="rice.jsp?imgid=?<%=resultset.getBlob(3)%>" width="50" height="50"></TD>   
  
  
                          </TR>   
       </TABLE>   
       <BR>   
       <%    
           }    
       %>   
  
<BODY bgcolor="#ffffcc">   
<font size="5" color="green"><a href="login.jsp">CLICK HERE TO GO BACK</a></font>   
  
  
    </BODY>   
</HTML>   
  
   
   


<%@ page import="java.sql.*" %>
<% Class.forName("com.mysql.jdbc.Driver"); %>

<HTML>
    <HEAD>
        <TITLE>Fetching Data From a Database</TITLE>
    </HEAD>

    <BODY>

    <center>
        <font size="7" color="green">Fetching Data From a Database</font>

    </center>

        <% 
            Connection connection = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/money", "root", "root");

            Statement statement = connection.createStatement();

            String email = request.getParameter("email");  

            ResultSet resultset = 
                statement.executeQuery("select * from login where id = '" + id + "'") ; 

            if(!resultset.next()) {
                out.println("SORRY, WE COULD NOT GET YOUR INFORMATIONS. ");
            } else {
           
        %>

        <TABLE BORDER="1">
            <TR>
               <TH>YOUR SURNAME:</TH>
               <TH>YOUR FIRSTNAME:</TH>
               <TH>YOUR image:</TH>
                          </TR>
           <TR>
               <TD> <%= resultset.getString(1) %> </TD>
               <TD> <%= resultset.getString(2) %> </TD>
               <TD> <%=resultset.getBlob(3)%>" width="50" height="50"></TD>


                          </TR>
       </TABLE>
       <BR>
       <% 
           } 
       %>

<BODY bgcolor="#ffffcc">
<font size="5" color="green"><a href="login.jsp">CLICK HERE TO GO BACK</a></font>


    </BODY>
</HTML>
THANKS AND GOD BLESS