File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Urgent..Problem while using java.sql.Blob in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Urgent..Problem while using java.sql.Blob in JSP" Watch "Urgent..Problem while using java.sql.Blob in JSP" New topic

Urgent..Problem while using java.sql.Blob in JSP

Srinivas Saranu

Joined: Oct 02, 2002
Posts: 7
i want to retrieve an image from oracle database which is stored in the database as BLOB. iam using JSP to display the image on the browser. Iam using tomcat 3.3 with apache 1.3. JDK 1.3
the code i have written in JSP is as follows
ResultSet rs=st.executeQuery("select picture from prt");
Blob data=rs.getBlob("picture");
byte[] b=data.getBytes(1,(int)(data.length()));
catch(Exception e){
when i execute the JSP page iam getting the following exception
Error: 500
Location: /dna/jsp/gcImages.jsp
Internal Servlet Error:
java.lang.AbstractMethodError at jsp.gcImages_1._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(
at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
at org.apache.tomcat.core.Handler.invoke(Unknown Source)
at org.apache.tomcat.core.Handler.service(Unknown Source)
at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Unknown Source)
at Source)
at org.apache.tomcat.util.threads.ThreadPool$ Source)
please help me who can.Thank you one and all
Sateesh Kumar K

Joined: Oct 16, 2001
Posts: 11
You need to Typecast the ResultSet to oracle.jdbc.driver.OracleResultSet and then you can use the
method of it..
I don't think default ResultSet will provide the implementation for fetching a BLOB Data type from Oracle.
Hope this will help..
Srinivas Saranu

Joined: Oct 02, 2002
Posts: 7
Thank you very much
I agree. Here's the link:
subject: Urgent..Problem while using java.sql.Blob in JSP
It's not a secret anymore!