Hi i tried to display an image from database using servlets/jdbc but i getting an exception "no resultset produced".the following is the code which i used.i will be glad if someone can help me in this regard. thanks in advance pramod import java.sql.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.* ; public class getblob extends HttpServlet { Connection con = null; public void init(ServletConfig sc) throws ServletException { super.init(sc); // Load the Oracle JDBC driver try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); System.out.println("driver loaded"); con =DriverManager.getConnection("jdbc:odbc:test","scott","tiger"); System.out.println("connected to database"); }catch (Exception e){ System.out.println(e); } } public void doGet(HttpServletRequest req , HttpServletResponse res) throws ServletException , IOException { try{ res.setContentType("image/gif"); ServletOutputStream out = res.getOutputStream() ; Statement st = con.createStatement() ; ResultSet rs = st.executeQuery("select image from imgblob where sno=101"); System.out.println("test"); while (rs.next()) { System.out.println("hi"); BufferedInputStream gif = new BufferedInputStream(rs.getBinaryStream("image")); byte[] buf = new byte[3*1024]; int len ; while ((len=gif.read(buf,0,buf.length))!=-1) { out.write(buf,0,len); } } }catch(Exception e){ System.out.println(e); } } } --------------------------------------------- Hi, The following is the code I used to show image on the screen. This code would be helpful, if you are storing images in the Oracle database. If you are using other database like DB2, mySQL. you don't need to go that difficult. public void returnImageFile (String query) throws IOException, SQLException { boolean headOnly; if (getRequest().getMethod().equalsIgnoreCase ("get")) headOnly = false; else if (!getRequest().getMethod().equalsIgnoreCase( "head")) headOnly = true; else { getResponse().sendError( HttpServletResponse.SC_NOT_IMPLEMENTED ); return; } Statement statement = null; ResultSet rs = null; try { statement = getConnection().createStatement (); rs = statement.executeQuery (query); if (rs.next()) { Blob blob = rs.getBlob (1); String image_mime = rs.getString (2); getResponse().setContentType (image_mime); ServletOutputStream outstream = getResponse().getOutputStream(); if (!headOnly) { // Get binary output stream to retrieve blob data InputStream instream = blob.getBinaryStream(); // Create temporary buffer for read byte[] buffer = new byte[10]; // length of bytes read int length = 0; // Fetch data while ((length = instream.read(buffer)) != -1) { outstream.write (buffer, 0, length); } // Close input stream instream.close(); } outstream.flush(); outstream.close(); } } catch (SQLException ex) { getResponse().sendError (HttpServletResponse.SC_NOT_FOUND); return; }