Illegal operation on empty result set.
Hi all !!!
could you please tell me the solution why <b>"Illegal operation on empty result set."</b> is coming.
I have to display the images from the database Mysql dynamically by pssing parameter "chartid"
<%@ page import="java.sql.*" %>
<%@ page import= "java.io.*" %>
<%
String connectionURL = "jdbc:mysql://localhost:3306/modelval?user=modval;password=modval";
Connection connection = null;
Statement statement = null;
%>
<%
String Id=request.getParameter("chartid");
Class.forName("com.mysql.jdbc.Driver").newInstance ();
connection = DriverManager.getConnection(connectionURL, "modval", "modval");
statement = connection.createStatement();
ResultSet rs1 = statement.executeQuery( "SELECT * FROM tab_charts where chartid= ' " + Id + " ' ");
rs1.next();
byte [] barray = rs1.getBytes("chart");
rs1.close();
statement.close();
response.setContentType("image/jpeg");
response.getOutputStream().write(barray);
%>
================================================== =============
i am not getting the display of images on jsp page....the image is stored as a blob in table tab_charts with the column name "chart"
but not getting the images....
please help me .Its reallly urgent...
thanx in advance
Amit Srivastava
__________________
Amit Srivastava
|